Search in sources :

Example 1 with ActivityStreamLikeInfos

use of org.entando.entando.apsadmin.system.services.activitystream.model.ActivityStreamLikeInfos in project entando-core by entando.

the class SocialActivityStreamDAO method getActionLikeRecords.

@Override
public List<ActivityStreamLikeInfo> getActionLikeRecords(int id) {
    List<ActivityStreamLikeInfo> infos = new ActivityStreamLikeInfos();
    Connection conn = null;
    PreparedStatement stat = null;
    ResultSet result = null;
    try {
        conn = this.getConnection();
        stat = conn.prepareStatement(GET_ACTION_LIKE_RECORDS);
        stat.setInt(1, id);
        result = stat.executeQuery();
        while (result.next()) {
            ActivityStreamLikeInfo asli = new ActivityStreamLikeInfo();
            asli.setUsername(result.getString(1));
            infos.add(asli);
        }
    } catch (Throwable t) {
        logger.error("Error while loading activity stream like records", t);
        throw new RuntimeException("Error while loading activity stream like records", t);
    } finally {
        closeDaoResources(result, stat, conn);
    }
    return infos;
}
Also used : Connection(java.sql.Connection) ResultSet(java.sql.ResultSet) PreparedStatement(java.sql.PreparedStatement) ActivityStreamLikeInfo(org.entando.entando.apsadmin.system.services.activitystream.model.ActivityStreamLikeInfo) ActivityStreamLikeInfos(org.entando.entando.apsadmin.system.services.activitystream.model.ActivityStreamLikeInfos)

Aggregations

Connection (java.sql.Connection)1 PreparedStatement (java.sql.PreparedStatement)1 ResultSet (java.sql.ResultSet)1 ActivityStreamLikeInfo (org.entando.entando.apsadmin.system.services.activitystream.model.ActivityStreamLikeInfo)1 ActivityStreamLikeInfos (org.entando.entando.apsadmin.system.services.activitystream.model.ActivityStreamLikeInfos)1