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