Class ConnectionDAOImpl

java.lang.Object
org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<ConnectionEntity,Long>
org.exoplatform.social.core.jpa.storage.dao.jpa.ConnectionDAOImpl
All Implemented Interfaces:
org.exoplatform.commons.api.persistence.GenericDAO<ConnectionEntity,Long>, ConnectionDAO

public class ConnectionDAOImpl extends org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<ConnectionEntity,Long> implements ConnectionDAO
  • Field Summary

    Fields inherited from class org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl

    modelClass
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    count(org.exoplatform.social.core.identity.model.Identity identity, org.exoplatform.social.core.relationship.model.Relationship.Type status)
    Has the connections
    getConnection(Long sender, Long reciver)
     
    getConnection(org.exoplatform.social.core.identity.model.Identity identity1, org.exoplatform.social.core.identity.model.Identity identity2)
    Get connection of 2 users
    getConnectionIds(long identityId, org.exoplatform.social.core.relationship.model.Relationship.Type status)
    Return list of identities with whom the passed identity in parameter has a confirmed relationship
    getConnections(org.exoplatform.social.core.identity.model.Identity sender, org.exoplatform.social.core.identity.model.Identity receiver, org.exoplatform.social.core.relationship.model.Relationship.Type status)
     
    getConnections(org.exoplatform.social.core.identity.model.Identity identity, org.exoplatform.social.core.relationship.model.Relationship.Type status, long offset, long limit, org.exoplatform.social.core.search.Sorting sorting)
     
    getConnectionsByFilter(org.exoplatform.social.core.identity.model.Identity existingIdentity, org.exoplatform.social.core.profile.ProfileFilter profileFilter, org.exoplatform.social.core.relationship.model.Relationship.Type type, long offset, long limit)
     
    int
    getConnectionsByFilterCount(org.exoplatform.social.core.identity.model.Identity identity, org.exoplatform.social.core.profile.ProfileFilter profileFilter, org.exoplatform.social.core.relationship.model.Relationship.Type type)
     
    int
    getConnectionsCount(org.exoplatform.social.core.identity.model.Identity identity, org.exoplatform.social.core.relationship.model.Relationship.Type status)
     
    int
     
    getLastConnections(org.exoplatform.social.core.identity.model.Identity identity, int limit)
     
    getReceiverIds(long senderId, org.exoplatform.social.core.relationship.model.Relationship.Type status, int offset, int limit)
     
    getSenderIds(long receiverId, org.exoplatform.social.core.relationship.model.Relationship.Type status, int offset, int limit)
     

    Methods inherited from class org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl

    count, create, createAll, delete, deleteAll, deleteAll, find, findAll, getEntityManager, getHibernateDialect, isMSSQLDialect, isOrcaleDialect, update, updateAll

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.exoplatform.commons.api.persistence.GenericDAO

    count, create, createAll, delete, deleteAll, deleteAll, find, findAll, update, updateAll
  • Constructor Details

    • ConnectionDAOImpl

      public ConnectionDAOImpl()
  • Method Details

    • count

      public long count(org.exoplatform.social.core.identity.model.Identity identity, org.exoplatform.social.core.relationship.model.Relationship.Type status)
      Description copied from interface: ConnectionDAO
      Has the connections
      Specified by:
      count in interface ConnectionDAO
      Parameters:
      identity - the Identity
      status - the status of connection
      Returns:
      number of connection
    • getConnection

      public ConnectionEntity getConnection(org.exoplatform.social.core.identity.model.Identity identity1, org.exoplatform.social.core.identity.model.Identity identity2)
      Description copied from interface: ConnectionDAO
      Get connection of 2 users
      Specified by:
      getConnection in interface ConnectionDAO
      Parameters:
      identity1 - The first Identity
      identity2 - the second Identity
      Returns:
      the connection entity
    • getConnection

      public ConnectionEntity getConnection(Long sender, Long reciver)
      Specified by:
      getConnection in interface ConnectionDAO
      Parameters:
      sender - the id of sender Identity
      reciver - the id of receiver Identity
      Returns:
      the connection entity
    • getConnections

      public List<ConnectionEntity> getConnections(org.exoplatform.social.core.identity.model.Identity identity, org.exoplatform.social.core.relationship.model.Relationship.Type status, long offset, long limit, org.exoplatform.social.core.search.Sorting sorting)
      Specified by:
      getConnections in interface ConnectionDAO
      Parameters:
      identity - the Identity
      status - type of connection
      offset - the start index
      limit - the max items to load
      sorting - sortby field name and sort direction
      Returns:
      list of connection entities
    • getConnectionIds

      public Set<Long> getConnectionIds(long identityId, org.exoplatform.social.core.relationship.model.Relationship.Type status)
      Description copied from interface: ConnectionDAO
      Return list of identities with whom the passed identity in parameter has a confirmed relationship
      Specified by:
      getConnectionIds in interface ConnectionDAO
      Parameters:
      identityId -
      status -
      Returns:
      Set of Identity ids
    • getConnections

      public List<ConnectionEntity> getConnections(org.exoplatform.social.core.identity.model.Identity sender, org.exoplatform.social.core.identity.model.Identity receiver, org.exoplatform.social.core.relationship.model.Relationship.Type status)
      Specified by:
      getConnections in interface ConnectionDAO
      Parameters:
      sender - the sender Identity
      receiver - the receiver Identity
      status - the connection status
      Returns:
      list of connection entities
    • getConnectionsCount

      public int getConnectionsCount(org.exoplatform.social.core.identity.model.Identity identity, org.exoplatform.social.core.relationship.model.Relationship.Type status)
      Specified by:
      getConnectionsCount in interface ConnectionDAO
      Parameters:
      identity - the Identity
      status - the connection type
      Returns:
      number of connections
    • getLastConnections

      public List<ConnectionEntity> getLastConnections(org.exoplatform.social.core.identity.model.Identity identity, int limit)
      Specified by:
      getLastConnections in interface ConnectionDAO
      Parameters:
      identity - the Identity
      limit - max item to load
      Returns:
      list of connection entities
    • getConnectionsByFilter

      public List<ConnectionEntity> getConnectionsByFilter(org.exoplatform.social.core.identity.model.Identity existingIdentity, org.exoplatform.social.core.profile.ProfileFilter profileFilter, org.exoplatform.social.core.relationship.model.Relationship.Type type, long offset, long limit)
      Specified by:
      getConnectionsByFilter in interface ConnectionDAO
      Parameters:
      existingIdentity - the Identity
      profileFilter - the ProfileFilter
      type - connection type
      offset - the start index
      limit - max items to load
      Returns:
      list of connection entities
    • getConnectionsByFilterCount

      public int getConnectionsByFilterCount(org.exoplatform.social.core.identity.model.Identity identity, org.exoplatform.social.core.profile.ProfileFilter profileFilter, org.exoplatform.social.core.relationship.model.Relationship.Type type)
      Specified by:
      getConnectionsByFilterCount in interface ConnectionDAO
      Parameters:
      identity - the Identity
      profileFilter - the profile filter
      type - connection type
      Returns:
      number of connections
    • getSenderIds

      public List<Long> getSenderIds(long receiverId, org.exoplatform.social.core.relationship.model.Relationship.Type status, int offset, int limit)
      Specified by:
      getSenderIds in interface ConnectionDAO
    • getReceiverIds

      public List<Long> getReceiverIds(long senderId, org.exoplatform.social.core.relationship.model.Relationship.Type status, int offset, int limit)
      Specified by:
      getReceiverIds in interface ConnectionDAO
    • getConnectionsInCommonCount

      public int getConnectionsInCommonCount(String id1, String id2)
      Specified by:
      getConnectionsInCommonCount in interface ConnectionDAO
      Parameters:
      id1 -
      id2 -
      Returns:
      connections in common count between two users