@Repository public class ConnectionRepository extends AbstractHibernateRepository<Connection,java.lang.Long>
Connection| Constructor and Description |
|---|
ConnectionRepository() |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<Connection> |
findAllConnectionsFor(User user)
Given a user, query the database to find all
Connection's for
a given User. |
java.util.List<User> |
findAllFollowers(User user)
Given a user, query the database to find all users that
follower the user.
|
java.util.List<java.lang.Long> |
findAllFollowersIDs(User user)
Given a user, query the database to find all users that follower
the user and return their IDs.
|
java.util.List<User> |
findAllFollowing(User user)
Given a user, query the database to find users that the
user follows.
|
java.util.List<java.lang.Long> |
findAllFollowingIDs(User user)
Given a
User, query the database to find all users
that the user followers and return their twitter ids. |
java.util.List<Connection> |
getByConfig(Config c)
|
Connection |
updateConnection(Connection update)
Update a single connection in the database.
|
java.util.List<Connection> |
updateConnections(java.util.List<Connection> updated)
Updates connections that are stored in the database.
|
count, delete, delete, delete, deleteAll, evict, exists, findAll, findAll, findAll, findAll, findOne, flush, getEntityClass, getSession, getUniqueObjects, save, savepublic java.util.List<Connection> findAllConnectionsFor(User user)
Connection's for
a given User.
select distinct c from Connection c where c.origin = :user or c.destination = :user
user - the given user to find all connections for.List,
Connection,
Userpublic java.util.List<User> findAllFollowers(User user)
select c.origin from Connection c where c.destination = :user
user - the given userList,
Userpublic java.util.List<User> findAllFollowing(User user)
select c.destination from Connection c where c.origin = :user
user - the given userList,
Userpublic java.util.List<java.lang.Long> findAllFollowersIDs(User user)
select c.origin.twitterId from Connection c where c.destination = :user
user - the given userLong)List,
Userpublic java.util.List<Connection> getByConfig(Config c)
Config, find all Connection's that
are part of a given Config.
select * from Connection where config = :c
c - the given configurationList,
Connection,
Configpublic java.util.List<java.lang.Long> findAllFollowingIDs(User user)
User, query the database to find all users
that the user followers and return their twitter ids.
selection c.destination.twitterId from Connection c where c.origin = :user
user - the given userLong's for twitter ids.List,
Long,
Userpublic java.util.List<Connection> updateConnections(java.util.List<Connection> updated)
updated - the updated connectionsConnectionpublic Connection updateConnection(Connection update)
update - the new connectionConnection