/** * Returns all entities of the given type. This actually peers the call to the {@link #find(Class, Query)} method. * * @param type The type of entity to retrieve. * @return An array of all entities which correspond to the given type. */ public <T extends RawEntity<K>, K> T[] find(Class<T> type) throws SQLException { return find(type, Query.select()); }
@Override public Object pullFromDatabase(EntityManager manager, ResultSet res, Class<Object> type, String columnName) throws SQLException { return manager.getProvider().handleBlob(res, type, columnName); }
public boolean apply(Method m) { final AnnotationDelegate annotations = getAnnotationDelegate(converter, m); return !annotations.isAnnotationPresent(Ignore.class) && !annotations.isAnnotationPresent(OneToOne.class) && !annotations.isAnnotationPresent(OneToMany.class) && !annotations.isAnnotationPresent(ManyToMany.class); } });
/** * Counts all entities of the specified type matching the given criteria and parameters. This is a convenience * method for: <code>count(type, Query.select().where(criteria, parameters))</code> * * @param type The type of the entities which should be counted. * @param criteria A parameterized WHERE statement used to determine the result set which will be counted. * @param parameters A varargs array of parameters to be passed to the executed prepared statement. The length of * this array <i>must</i> match the number of parameters (denoted by the '?' char) in the <code>criteria</code>. * @return The number of entities of the given type which match the specified criteria. */ public <K> int count(Class<? extends RawEntity<K>> type, String criteria, Object... parameters) throws SQLException { return count(type, Query.select().where(criteria, parameters)); }
/** * Counts all entities of the specified type. This method is actually a delegate for: <code>count(Class<? * extends Entity>, Query)</code> * * @param type The type of the entities which should be counted. * @return The number of entities of the specified type. */ public <K> int count(Class<? extends RawEntity<K>> type) throws SQLException { return count(type, Query.select()); }
private TypeManager getTypeManager() { return getManager().getProvider().getTypeManager(); }
@Override public void putToDatabase(EntityManager manager, PreparedStatement stmt, int index, Boolean value, int jdbcType) throws SQLException { manager.getProvider().putBoolean(stmt, index, value); }
public void init(T instance) { init(instance, instance.getEntityType()); initialized = true; }
private boolean isIndexed(Method method) { final AnnotationDelegate annotations = Common.getAnnotationDelegate(fieldNameConverter, method); final Indexed indexed = annotations.getAnnotation(Indexed.class); return indexed != null; }
/** * Counts all entities of the specified type matching the given criteria and parameters. This is a convenience * method for: <code>count(type, Query.select().where(criteria, parameters))</code> * * @param type The type of the entities which should be counted. * @param criteria A parameterized WHERE statement used to determine the result set which will be counted. * @param parameters A varargs array of parameters to be passed to the executed prepared statement. The length of * this array <i>must</i> match the number of parameters (denoted by the '?' char) in the <code>criteria</code>. * @return The number of entities of the given type which match the specified criteria. */ public <K> int count(Class<? extends RawEntity<K>> type, String criteria, Object... parameters) throws SQLException { return count(type, Query.select().where(criteria, parameters)); }
/** * Returns all entities of the given type. This actually peers the call to the {@link #find(Class, Query)} method. * * @param type The type of entity to retrieve. * @return An array of all entities which correspond to the given type. */ public <T extends RawEntity<K>, K> T[] find(Class<T> type) throws SQLException { return find(type, Query.select()); }
/** * Counts all entities of the specified type. This method is actually a delegate for: <code>count(Class<? * extends Entity>, Query)</code> * * @param type The type of the entities which should be counted. * @return The number of entities of the specified type. */ public <K> int count(Class<? extends RawEntity<K>> type) throws SQLException { return count(type, Query.select()); }
private TypeManager getTypeManager() { return getManager().getProvider().getTypeManager(); }
@Override public Object pullFromDatabase(EntityManager manager, ResultSet res, Class<Object> type, String columnName) throws SQLException { return manager.getProvider().handleBlob(res, type, columnName); }
@Override public void putToDatabase(EntityManager manager, PreparedStatement stmt, int index, Boolean value, int jdbcType) throws SQLException { manager.getProvider().putBoolean(stmt, index, value); }
public boolean apply(Method m) { final AnnotationDelegate annotations = getAnnotationDelegate(converter, m); return !annotations.isAnnotationPresent(Ignore.class) && !annotations.isAnnotationPresent(OneToOne.class) && !annotations.isAnnotationPresent(OneToMany.class) && !annotations.isAnnotationPresent(ManyToMany.class); } });
public void init(T instance) { init(instance, instance.getEntityType()); initialized = true; }
private boolean isIndexed(Method method) { final AnnotationDelegate annotations = Common.getAnnotationDelegate(fieldNameConverter, method); final Indexed indexed = annotations.getAnnotation(Indexed.class); return indexed != null; }