com.silverpeas.socialnetwork.invitation
Class InvitationDao

java.lang.Object
  extended by com.silverpeas.socialnetwork.invitation.InvitationDao

public class InvitationDao
extends Object


Constructor Summary
InvitationDao()
           
 
Method Summary
 int createInvitation(Connection connection, Invitation invitation)
          Create new invitation
 boolean deleteInvitation(Connection connection, int invitationId)
          Delete invitation return true when this invitation was deleting
 boolean deleteSameInvitations(Connection connection, int invitationId)
          Delete invitations from same receiver and sender Delete nothing if invitation doesn't exist Delete one invitation if only one invitation has been sent from sender to receiver Delete two invitations if sender and receiver has sent an invitation
 List<Invitation> getAllMyInvitationsReceive(Connection connection, int myId)
          return All my invitations received
 List<Invitation> getAllMyInvitationsSent(Connection connection, int myId)
          return All my invitations sented
 Invitation getInvitation(Connection connection, int id)
          retrieve an invitation
 Invitation getInvitation(Connection connection, int senderId, int receiverId)
           
 boolean isExists(Connection connection, int senderId, int receiverId)
          return true if this invitation exist between 2 users
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InvitationDao

public InvitationDao()
Method Detail

createInvitation

public int createInvitation(Connection connection,
                            Invitation invitation)
                     throws UtilException,
                            SQLException
Create new invitation

Parameters:
connection -
invitation -
Returns:
int the id of invitation
Throws:
UtilException
SQLException

deleteInvitation

public boolean deleteInvitation(Connection connection,
                                int invitationId)
                         throws SQLException
Delete invitation return true when this invitation was deleting

Parameters:
connection -
invitationId - the invitation identifier
Returns:
boolean
Throws:
SQLException

deleteSameInvitations

public boolean deleteSameInvitations(Connection connection,
                                     int invitationId)
                              throws SQLException
Delete invitations from same receiver and sender

Parameters:
connection -
invitationId - the invitation identifier
Returns:
true true when invitations from same sender identifier and receiver identifier are deleted, false else if
Throws:
SQLException

getInvitation

public Invitation getInvitation(Connection connection,
                                int senderId,
                                int receiverId)
                         throws SQLException
Parameters:
connection - a Connection
senderId - the sender identifier
receiverId - the receiver identifier
Returns:
invitation between 2 users
Throws:
SQLException

getInvitation

public Invitation getInvitation(Connection connection,
                                int id)
                         throws SQLException
retrieve an invitation

Parameters:
connection -
id -
Returns:
Invitation
Throws:
SQLException

isExists

public boolean isExists(Connection connection,
                        int senderId,
                        int receiverId)
                 throws SQLException
return true if this invitation exist between 2 users

Parameters:
connection -
senderId -
receiverId -
Returns:
boolean
Throws:
SQLException

getAllMyInvitationsSent

public List<Invitation> getAllMyInvitationsSent(Connection connection,
                                                int myId)
                                         throws SQLException
return All my invitations sented

Parameters:
connection -
myId -
Returns:
List
Throws:
SQLException

getAllMyInvitationsReceive

public List<Invitation> getAllMyInvitationsReceive(Connection connection,
                                                   int myId)
                                            throws SQLException
return All my invitations received

Parameters:
connection -
myId -
Returns:
List
Throws:
SQLException


Copyright © 2016 Silverpeas. All Rights Reserved.