return database.getMultiple(query, new StringCreator("USER_OPENIDS.OPENID"));
}
+ //
+ // PRIVATE METHODS
+ //
+
+ /**
+ * Loads the properties for the given object.
+ *
+ * @param <T>
+ * The type of the object
+ * @param object
+ * The object
+ * @param table
+ * The table to load the properties from
+ * @param type
+ * The type of the object (“ARTIST,” “TRACK,” etc.)
+ * @return The object with its properties loaded
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ private <T extends Base> T loadProperties(final T object, final String table, String type) throws DatabaseException {
+ Query query = new Query(Type.SELECT, table);
+ query.addField(new Field(table + ".PROPERTY"));
+ query.addField(new Field(table + ".VALUE"));
+ query.addWhereClause(new ValueFieldWhereClause(new ValueField(type, new StringParameter(object.getId()))));
+ database.process(query, new ResultProcessor() {
+
+ @Override
+ public void processResult(ResultSet resultSet) throws SQLException {
+ if (resultSet.isFirst()) {
+ object.getProperties().removeAll();
+ }
+ object.getProperties().set(resultSet.getString(table + ".PROPERTY"), resultSet.getString(table + ".VALUE"));
+ }
+
+ });
+ return object;
+ }
+
/**
* {@link Artist} implementation that retrieves some attributes (such as
* {@link #getGroups()}, and {@link #getTracks()}) from the