PredefinedQueries.java revision cf3ded7a02a85e9a249254ba37c8bc82d31b831a
public class PredefinedQueries {
/**
* Query by primary key, the OpenIDM identifier. This identifier is different from the OrientDB record id.
*
* @param id the OpenIDM identifier for an object
* @param type the OrientDB class
* @param database a handle to the OrientDB database object. No other thread must operate on this concurrently.
* @return The ODocument if found, null if not found.
* @throws IllegalArgumentException if the passed identifier or type are invalid
*/
public ODocument getByID(final String id, final String type, ODatabaseDocumentTx database) throws IllegalArgumentException {
throw new IllegalArgumentException("Query by id the passed id was null.");
throw new IllegalArgumentException("Query by id the passed type was null.");
}
// TODO: convert into a prepared statement
OSQLSynchQuery<ODocument> query = new OSQLSynchQuery<ODocument>("select * from " + type + " where " + DocumentUtil.ORIENTDB_PRIMARY_KEY + " = '" + id + "'");
}
return first;
}
}