001 /** 002 * Copyright (c) 2000-present Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portlet.social.service; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.service.ServiceWrapper; 020 021 /** 022 * Provides a wrapper for {@link SocialRelationLocalService}. 023 * 024 * @author Brian Wing Shun Chan 025 * @see SocialRelationLocalService 026 * @generated 027 */ 028 @ProviderType 029 public class SocialRelationLocalServiceWrapper 030 implements SocialRelationLocalService, 031 ServiceWrapper<SocialRelationLocalService> { 032 public SocialRelationLocalServiceWrapper( 033 SocialRelationLocalService socialRelationLocalService) { 034 _socialRelationLocalService = socialRelationLocalService; 035 } 036 037 /** 038 * Adds a social relation between the two users to the database. 039 * 040 * @param userId1 the user that is the subject of the relation 041 * @param userId2 the user at the other end of the relation 042 * @param type the type of the relation 043 * @return the social relation 044 * @throws PortalException if the users could not be found, if the users 045 were not from the same company, or if either of the users was the 046 default user 047 */ 048 @Override 049 public com.liferay.portlet.social.model.SocialRelation addRelation( 050 long userId1, long userId2, int type) 051 throws com.liferay.portal.kernel.exception.PortalException { 052 return _socialRelationLocalService.addRelation(userId1, userId2, type); 053 } 054 055 /** 056 * Adds the social relation to the database. Also notifies the appropriate model listeners. 057 * 058 * @param socialRelation the social relation 059 * @return the social relation that was added 060 */ 061 @Override 062 public com.liferay.portlet.social.model.SocialRelation addSocialRelation( 063 com.liferay.portlet.social.model.SocialRelation socialRelation) { 064 return _socialRelationLocalService.addSocialRelation(socialRelation); 065 } 066 067 /** 068 * Creates a new social relation with the primary key. Does not add the social relation to the database. 069 * 070 * @param relationId the primary key for the new social relation 071 * @return the new social relation 072 */ 073 @Override 074 public com.liferay.portlet.social.model.SocialRelation createSocialRelation( 075 long relationId) { 076 return _socialRelationLocalService.createSocialRelation(relationId); 077 } 078 079 /** 080 * @throws PortalException 081 */ 082 @Override 083 public com.liferay.portal.model.PersistedModel deletePersistedModel( 084 com.liferay.portal.model.PersistedModel persistedModel) 085 throws com.liferay.portal.kernel.exception.PortalException { 086 return _socialRelationLocalService.deletePersistedModel(persistedModel); 087 } 088 089 /** 090 * Removes the relation (and its inverse in case of a bidirectional 091 * relation) from the database. 092 * 093 * @param relation the relation to be removed 094 * @throws PortalException if the relation is bidirectional and its inverse 095 relation could not be found 096 */ 097 @Override 098 public void deleteRelation( 099 com.liferay.portlet.social.model.SocialRelation relation) 100 throws com.liferay.portal.kernel.exception.PortalException { 101 _socialRelationLocalService.deleteRelation(relation); 102 } 103 104 /** 105 * Removes the relation (and its inverse in case of a bidirectional 106 * relation) from the database. 107 * 108 * @param relationId the primary key of the relation 109 * @throws PortalException if the relation could not be found 110 */ 111 @Override 112 public void deleteRelation(long relationId) 113 throws com.liferay.portal.kernel.exception.PortalException { 114 _socialRelationLocalService.deleteRelation(relationId); 115 } 116 117 /** 118 * Removes the matching relation (and its inverse in case of a bidirectional 119 * relation) from the database. 120 * 121 * @param userId1 the user that is the subject of the relation 122 * @param userId2 the user at the other end of the relation 123 * @param type the relation's type 124 * @throws PortalException if the relation or its inverse relation (if 125 applicable) could not be found 126 */ 127 @Override 128 public void deleteRelation(long userId1, long userId2, int type) 129 throws com.liferay.portal.kernel.exception.PortalException { 130 _socialRelationLocalService.deleteRelation(userId1, userId2, type); 131 } 132 133 /** 134 * Removes all relations involving the user from the database. 135 * 136 * @param userId the primary key of the user 137 */ 138 @Override 139 public void deleteRelations(long userId) { 140 _socialRelationLocalService.deleteRelations(userId); 141 } 142 143 /** 144 * Removes all relations between User1 and User2. 145 * 146 * @param userId1 the user that is the subject of the relation 147 * @param userId2 the user at the other end of the relation 148 * @throws PortalException if the inverse relation could not be found 149 */ 150 @Override 151 public void deleteRelations(long userId1, long userId2) 152 throws com.liferay.portal.kernel.exception.PortalException { 153 _socialRelationLocalService.deleteRelations(userId1, userId2); 154 } 155 156 /** 157 * Deletes the social relation with the primary key from the database. Also notifies the appropriate model listeners. 158 * 159 * @param relationId the primary key of the social relation 160 * @return the social relation that was removed 161 * @throws PortalException if a social relation with the primary key could not be found 162 */ 163 @Override 164 public com.liferay.portlet.social.model.SocialRelation deleteSocialRelation( 165 long relationId) 166 throws com.liferay.portal.kernel.exception.PortalException { 167 return _socialRelationLocalService.deleteSocialRelation(relationId); 168 } 169 170 /** 171 * Deletes the social relation from the database. Also notifies the appropriate model listeners. 172 * 173 * @param socialRelation the social relation 174 * @return the social relation that was removed 175 */ 176 @Override 177 public com.liferay.portlet.social.model.SocialRelation deleteSocialRelation( 178 com.liferay.portlet.social.model.SocialRelation socialRelation) { 179 return _socialRelationLocalService.deleteSocialRelation(socialRelation); 180 } 181 182 @Override 183 public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 184 return _socialRelationLocalService.dynamicQuery(); 185 } 186 187 /** 188 * Performs a dynamic query on the database and returns the matching rows. 189 * 190 * @param dynamicQuery the dynamic query 191 * @return the matching rows 192 */ 193 @Override 194 public <T> java.util.List<T> dynamicQuery( 195 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 196 return _socialRelationLocalService.dynamicQuery(dynamicQuery); 197 } 198 199 /** 200 * Performs a dynamic query on the database and returns a range of the matching rows. 201 * 202 * <p> 203 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.social.model.impl.SocialRelationModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 204 * </p> 205 * 206 * @param dynamicQuery the dynamic query 207 * @param start the lower bound of the range of model instances 208 * @param end the upper bound of the range of model instances (not inclusive) 209 * @return the range of matching rows 210 */ 211 @Override 212 public <T> java.util.List<T> dynamicQuery( 213 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 214 int end) { 215 return _socialRelationLocalService.dynamicQuery(dynamicQuery, start, end); 216 } 217 218 /** 219 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 220 * 221 * <p> 222 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.social.model.impl.SocialRelationModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 223 * </p> 224 * 225 * @param dynamicQuery the dynamic query 226 * @param start the lower bound of the range of model instances 227 * @param end the upper bound of the range of model instances (not inclusive) 228 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 229 * @return the ordered range of matching rows 230 */ 231 @Override 232 public <T> java.util.List<T> dynamicQuery( 233 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 234 int end, 235 com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) { 236 return _socialRelationLocalService.dynamicQuery(dynamicQuery, start, 237 end, orderByComparator); 238 } 239 240 /** 241 * Returns the number of rows matching the dynamic query. 242 * 243 * @param dynamicQuery the dynamic query 244 * @return the number of rows matching the dynamic query 245 */ 246 @Override 247 public long dynamicQueryCount( 248 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 249 return _socialRelationLocalService.dynamicQueryCount(dynamicQuery); 250 } 251 252 /** 253 * Returns the number of rows matching the dynamic query. 254 * 255 * @param dynamicQuery the dynamic query 256 * @param projection the projection to apply to the query 257 * @return the number of rows matching the dynamic query 258 */ 259 @Override 260 public long dynamicQueryCount( 261 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 262 com.liferay.portal.kernel.dao.orm.Projection projection) { 263 return _socialRelationLocalService.dynamicQueryCount(dynamicQuery, 264 projection); 265 } 266 267 @Override 268 public com.liferay.portlet.social.model.SocialRelation fetchSocialRelation( 269 long relationId) { 270 return _socialRelationLocalService.fetchSocialRelation(relationId); 271 } 272 273 /** 274 * Returns the social relation with the matching UUID and company. 275 * 276 * @param uuid the social relation's UUID 277 * @param companyId the primary key of the company 278 * @return the matching social relation, or <code>null</code> if a matching social relation could not be found 279 */ 280 @Override 281 public com.liferay.portlet.social.model.SocialRelation fetchSocialRelationByUuidAndCompanyId( 282 java.lang.String uuid, long companyId) { 283 return _socialRelationLocalService.fetchSocialRelationByUuidAndCompanyId(uuid, 284 companyId); 285 } 286 287 @Override 288 public com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() { 289 return _socialRelationLocalService.getActionableDynamicQuery(); 290 } 291 292 /** 293 * Returns the Spring bean ID for this bean. 294 * 295 * @return the Spring bean ID for this bean 296 */ 297 @Override 298 public java.lang.String getBeanIdentifier() { 299 return _socialRelationLocalService.getBeanIdentifier(); 300 } 301 302 /** 303 * Returns a range of all the inverse relations of the given type for which 304 * the user is User2 of the relation. 305 * 306 * <p> 307 * Useful when paginating results. Returns a maximum of <code>end - 308 * start</code> instances. <code>start</code> and <code>end</code> are not 309 * primary keys, they are indexes in the result set. Thus, <code>0</code> 310 * refers to the first result in the set. Setting both <code>start</code> 311 * and <code>end</code> to {@link 312 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 313 * result set. 314 * </p> 315 * 316 * @param userId the primary key of the user 317 * @param type the relation's type 318 * @param start the lower bound of the range of results 319 * @param end the upper bound of the range of results (not inclusive) 320 * @return the range of matching relations 321 */ 322 @Override 323 public java.util.List<com.liferay.portlet.social.model.SocialRelation> getInverseRelations( 324 long userId, int type, int start, int end) { 325 return _socialRelationLocalService.getInverseRelations(userId, type, 326 start, end); 327 } 328 329 /** 330 * Returns the number of inverse relations of the given type for which the 331 * user is User2 of the relation. 332 * 333 * @param userId the primary key of the user 334 * @param type the relation's type 335 * @return the number of matching relations 336 */ 337 @Override 338 public int getInverseRelationsCount(long userId, int type) { 339 return _socialRelationLocalService.getInverseRelationsCount(userId, type); 340 } 341 342 @Override 343 public com.liferay.portal.model.PersistedModel getPersistedModel( 344 java.io.Serializable primaryKeyObj) 345 throws com.liferay.portal.kernel.exception.PortalException { 346 return _socialRelationLocalService.getPersistedModel(primaryKeyObj); 347 } 348 349 /** 350 * Returns the relation identified by its primary key. 351 * 352 * @param relationId the primary key of the relation 353 * @return Returns the relation 354 * @throws PortalException if the relation could not be found 355 */ 356 @Override 357 public com.liferay.portlet.social.model.SocialRelation getRelation( 358 long relationId) 359 throws com.liferay.portal.kernel.exception.PortalException { 360 return _socialRelationLocalService.getRelation(relationId); 361 } 362 363 /** 364 * Returns the relation of the given type between User1 and User2. 365 * 366 * @param userId1 the user that is the subject of the relation 367 * @param userId2 the user at the other end of the relation 368 * @param type the relation's type 369 * @return Returns the relation 370 * @throws PortalException if the relation could not be found 371 */ 372 @Override 373 public com.liferay.portlet.social.model.SocialRelation getRelation( 374 long userId1, long userId2, int type) 375 throws com.liferay.portal.kernel.exception.PortalException { 376 return _socialRelationLocalService.getRelation(userId1, userId2, type); 377 } 378 379 /** 380 * Returns a range of all the relations of the given type where the user is 381 * the subject of the relation. 382 * 383 * <p> 384 * Useful when paginating results. Returns a maximum of <code>end - 385 * start</code> instances. <code>start</code> and <code>end</code> are not 386 * primary keys, they are indexes in the result set. Thus, <code>0</code> 387 * refers to the first result in the set. Setting both <code>start</code> 388 * and <code>end</code> to {@link 389 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 390 * result set. 391 * </p> 392 * 393 * @param userId the primary key of the user 394 * @param type the relation's type 395 * @param start the lower bound of the range of results 396 * @param end the upper bound of the range of results (not inclusive) 397 * @return the range of relations 398 */ 399 @Override 400 public java.util.List<com.liferay.portlet.social.model.SocialRelation> getRelations( 401 long userId, int type, int start, int end) { 402 return _socialRelationLocalService.getRelations(userId, type, start, end); 403 } 404 405 /** 406 * Returns a range of all the relations between User1 and User2. 407 * 408 * <p> 409 * Useful when paginating results. Returns a maximum of <code>end - 410 * start</code> instances. <code>start</code> and <code>end</code> are not 411 * primary keys, they are indexes in the result set. Thus, <code>0</code> 412 * refers to the first result in the set. Setting both <code>start</code> 413 * and <code>end</code> to {@link 414 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 415 * result set. 416 * </p> 417 * 418 * @param userId1 the user that is the subject of the relation 419 * @param userId2 the user at the other end of the relation 420 * @param start the lower bound of the range of results 421 * @param end the upper bound of the range of results (not inclusive) 422 * @return the range of relations 423 */ 424 @Override 425 public java.util.List<com.liferay.portlet.social.model.SocialRelation> getRelations( 426 long userId1, long userId2, int start, int end) { 427 return _socialRelationLocalService.getRelations(userId1, userId2, 428 start, end); 429 } 430 431 /** 432 * Returns the number of relations of the given type where the user is the 433 * subject of the relation. 434 * 435 * @param userId the primary key of the user 436 * @param type the relation's type 437 * @return the number of relations 438 */ 439 @Override 440 public int getRelationsCount(long userId, int type) { 441 return _socialRelationLocalService.getRelationsCount(userId, type); 442 } 443 444 /** 445 * Returns the number of relations between User1 and User2. 446 * 447 * @param userId1 the user that is the subject of the relation 448 * @param userId2 the user at the other end of the relation 449 * @return the number of relations 450 */ 451 @Override 452 public int getRelationsCount(long userId1, long userId2) { 453 return _socialRelationLocalService.getRelationsCount(userId1, userId2); 454 } 455 456 /** 457 * Returns the social relation with the primary key. 458 * 459 * @param relationId the primary key of the social relation 460 * @return the social relation 461 * @throws PortalException if a social relation with the primary key could not be found 462 */ 463 @Override 464 public com.liferay.portlet.social.model.SocialRelation getSocialRelation( 465 long relationId) 466 throws com.liferay.portal.kernel.exception.PortalException { 467 return _socialRelationLocalService.getSocialRelation(relationId); 468 } 469 470 /** 471 * Returns the social relation with the matching UUID and company. 472 * 473 * @param uuid the social relation's UUID 474 * @param companyId the primary key of the company 475 * @return the matching social relation 476 * @throws PortalException if a matching social relation could not be found 477 */ 478 @Override 479 public com.liferay.portlet.social.model.SocialRelation getSocialRelationByUuidAndCompanyId( 480 java.lang.String uuid, long companyId) 481 throws com.liferay.portal.kernel.exception.PortalException { 482 return _socialRelationLocalService.getSocialRelationByUuidAndCompanyId(uuid, 483 companyId); 484 } 485 486 /** 487 * Returns a range of all the social relations. 488 * 489 * <p> 490 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.social.model.impl.SocialRelationModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 491 * </p> 492 * 493 * @param start the lower bound of the range of social relations 494 * @param end the upper bound of the range of social relations (not inclusive) 495 * @return the range of social relations 496 */ 497 @Override 498 public java.util.List<com.liferay.portlet.social.model.SocialRelation> getSocialRelations( 499 int start, int end) { 500 return _socialRelationLocalService.getSocialRelations(start, end); 501 } 502 503 /** 504 * Returns the number of social relations. 505 * 506 * @return the number of social relations 507 */ 508 @Override 509 public int getSocialRelationsCount() { 510 return _socialRelationLocalService.getSocialRelationsCount(); 511 } 512 513 /** 514 * Returns <code>true</code> if a relation of the given type exists where 515 * the user with primary key <code>userId1</code> is User1 of the relation 516 * and the user with the primary key <code>userId2</code> is User2 of the 517 * relation. 518 * 519 * @param userId1 the user that is the subject of the relation 520 * @param userId2 the user at the other end of the relation 521 * @param type the relation's type 522 * @return <code>true</code> if the relation exists; <code>false</code> 523 otherwise 524 */ 525 @Override 526 public boolean hasRelation(long userId1, long userId2, int type) { 527 return _socialRelationLocalService.hasRelation(userId1, userId2, type); 528 } 529 530 /** 531 * Returns <code>true</code> if the users can be in a relation of the given 532 * type where the user with primary key <code>userId1</code> is User1 of the 533 * relation and the user with the primary key <code>userId2</code> is User2 534 * of the relation. 535 * 536 * <p> 537 * This method returns <code>false</code> if User1 and User2 are the same, 538 * if either user is the default user, or if a matching relation already 539 * exists. 540 * </p> 541 * 542 * @param userId1 the user that is the subject of the relation 543 * @param userId2 the user at the other end of the relation 544 * @param type the relation's type 545 * @return <code>true</code> if the two users can be in a new relation of 546 the given type; <code>false</code> otherwise 547 */ 548 @Override 549 public boolean isRelatable(long userId1, long userId2, int type) { 550 return _socialRelationLocalService.isRelatable(userId1, userId2, type); 551 } 552 553 /** 554 * Sets the Spring bean ID for this bean. 555 * 556 * @param beanIdentifier the Spring bean ID for this bean 557 */ 558 @Override 559 public void setBeanIdentifier(java.lang.String beanIdentifier) { 560 _socialRelationLocalService.setBeanIdentifier(beanIdentifier); 561 } 562 563 /** 564 * Updates the social relation in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 565 * 566 * @param socialRelation the social relation 567 * @return the social relation that was updated 568 */ 569 @Override 570 public com.liferay.portlet.social.model.SocialRelation updateSocialRelation( 571 com.liferay.portlet.social.model.SocialRelation socialRelation) { 572 return _socialRelationLocalService.updateSocialRelation(socialRelation); 573 } 574 575 /** 576 * @deprecated As of 6.1.0, replaced by {@link #getWrappedService} 577 */ 578 @Deprecated 579 public SocialRelationLocalService getWrappedSocialRelationLocalService() { 580 return _socialRelationLocalService; 581 } 582 583 /** 584 * @deprecated As of 6.1.0, replaced by {@link #setWrappedService} 585 */ 586 @Deprecated 587 public void setWrappedSocialRelationLocalService( 588 SocialRelationLocalService socialRelationLocalService) { 589 _socialRelationLocalService = socialRelationLocalService; 590 } 591 592 @Override 593 public SocialRelationLocalService getWrappedService() { 594 return _socialRelationLocalService; 595 } 596 597 @Override 598 public void setWrappedService( 599 SocialRelationLocalService socialRelationLocalService) { 600 _socialRelationLocalService = socialRelationLocalService; 601 } 602 603 private SocialRelationLocalService _socialRelationLocalService; 604 }