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 -
Method Summary
Modifier and TypeMethodDescriptionlongcount(org.exoplatform.social.core.identity.model.Identity identity, org.exoplatform.social.core.relationship.model.Relationship.Type status) Has the connectionsgetConnection(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 usersgetConnectionIds(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 relationshipgetConnections(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) intgetConnectionsByFilterCount(org.exoplatform.social.core.identity.model.Identity identity, org.exoplatform.social.core.profile.ProfileFilter profileFilter, org.exoplatform.social.core.relationship.model.Relationship.Type type) intgetConnectionsCount(org.exoplatform.social.core.identity.model.Identity identity, org.exoplatform.social.core.relationship.model.Relationship.Type status) intgetConnectionsInCommonCount(String id1, String id2) 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, updateAllMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:ConnectionDAOHas the connections- Specified by:
countin interfaceConnectionDAO- Parameters:
identity- the Identitystatus- 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:ConnectionDAOGet connection of 2 users- Specified by:
getConnectionin interfaceConnectionDAO- Parameters:
identity1- The first Identityidentity2- the second Identity- Returns:
- the connection entity
-
getConnection
- Specified by:
getConnectionin interfaceConnectionDAO- Parameters:
sender- the id of sender Identityreciver- 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:
getConnectionsin interfaceConnectionDAO- Parameters:
identity- the Identitystatus- type of connectionoffset- the start indexlimit- the max items to loadsorting- 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:ConnectionDAOReturn list of identities with whom the passed identity in parameter has a confirmed relationship- Specified by:
getConnectionIdsin interfaceConnectionDAO- Parameters:
identityId-status-- Returns:
SetofIdentityids
-
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:
getConnectionsin interfaceConnectionDAO- Parameters:
sender- the sender Identityreceiver- the receiver Identitystatus- 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:
getConnectionsCountin interfaceConnectionDAO- Parameters:
identity- the Identitystatus- the connection type- Returns:
- number of connections
-
getLastConnections
public List<ConnectionEntity> getLastConnections(org.exoplatform.social.core.identity.model.Identity identity, int limit) - Specified by:
getLastConnectionsin interfaceConnectionDAO- Parameters:
identity- the Identitylimit- 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:
getConnectionsByFilterin interfaceConnectionDAO- Parameters:
existingIdentity- the IdentityprofileFilter- the ProfileFiltertype- connection typeoffset- the start indexlimit- 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:
getConnectionsByFilterCountin interfaceConnectionDAO- Parameters:
identity- the IdentityprofileFilter- the profile filtertype- 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:
getSenderIdsin interfaceConnectionDAO
-
getReceiverIds
public List<Long> getReceiverIds(long senderId, org.exoplatform.social.core.relationship.model.Relationship.Type status, int offset, int limit) - Specified by:
getReceiverIdsin interfaceConnectionDAO
-
getConnectionsInCommonCount
- Specified by:
getConnectionsInCommonCountin interfaceConnectionDAO- Parameters:
id1-id2-- Returns:
- connections in common count between two users
-