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