use of org.qi4j.entitystore.sql.internal.DatabaseSQLService.EntityValueResult in project qi4j-sdk by Qi4j.
the class SQLEntityStoreMixin method getValue.
protected EntityValueResult getValue(EntityReference ref) {
Connection connection = null;
PreparedStatement ps = null;
ResultSet rs = null;
try {
connection = database.getConnection();
ps = database.prepareGetEntityStatement(connection);
database.populateGetEntityStatement(ps, ref);
rs = ps.executeQuery();
if (!rs.next()) {
throw new EntityNotFoundException(ref);
}
EntityValueResult result = database.getEntityValue(rs);
return result;
} catch (SQLException sqle) {
throw new EntityStoreException("Unable to get Entity " + ref, sqle);
} finally {
SQLUtil.closeQuietly(rs);
SQLUtil.closeQuietly(ps);
SQLUtil.closeQuietly(connection);
}
}
Aggregations