|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.java.ao.Common
public final class Common
WARNING: Not part of the public API. This class is public only to allow its use within other packages in the ActiveObjects library.
Constructor Summary | |
---|---|
Common()
|
Method Summary | ||
---|---|---|
static void |
closeQuietly(Connection connection)
Closes the Connection in a null safe manner and quietly, i.e without throwing nor logging
any exception |
|
static void |
closeQuietly(ResultSet resultSet)
Closes the ResultSet in a null safe manner and quietly, i.e without throwing nor logging
any exception |
|
static void |
closeQuietly(Statement statement)
Closes the Statement in a null safe manner and quietly, i.e without throwing nor logging
any exception |
|
static String |
convert(FieldNameConverter fnc,
String column)
|
|
static String |
convertDowncaseName(String name)
|
|
static String |
convertSimpleClassName(String name)
|
|
static
|
createPeer(EntityManager manager,
Class<T> type,
K key)
|
|
static Method |
findCounterpart(FieldNameConverter converter,
Method method)
Finds the corresponding method in an accessor/mutator pair based on the given method (or null if no corresponding method). |
|
static boolean |
fuzzyCompare(Object a,
Object b)
|
|
static boolean |
fuzzyTypeCompare(int typeA,
int typeB)
|
|
static AnnotationDelegate |
getAnnotationDelegate(FieldNameConverter converter,
Method method)
Note: this method leads to the creation and quick discard of large numbers of AnnotationDelegate objects. |
|
static Class<?> |
getAttributeTypeFromMethod(Method method)
|
|
static String |
getCallingClassName(int depth)
|
|
static String[] |
getMappingFields(FieldNameConverter converter,
Class<? extends RawEntity<?>> from,
Class<? extends RawEntity<?>> to)
|
|
static String[] |
getPolymorphicFieldNames(FieldNameConverter converter,
Class<? extends RawEntity<?>> from,
Class<? extends RawEntity<?>> to)
|
|
static Method |
getPrimaryKeyAccessor(Class<? extends RawEntity<?>> type)
|
|
static
|
getPrimaryKeyClassType(Class<? extends RawEntity<K>> type)
|
|
static String |
getPrimaryKeyField(Class<? extends RawEntity<?>> type,
FieldNameConverter converter)
|
|
static Method |
getPrimaryKeyMethod(Class<? extends RawEntity<?>> type)
|
|
static
|
getPrimaryKeyType(Class<? extends RawEntity<K>> type)
|
|
static
|
getPrimaryKeyValue(RawEntity<K> entity)
|
|
static List<String> |
getSearchableFields(EntityManager manager,
Class<? extends RawEntity<?>> type)
|
|
static Set<Method> |
getValueFieldsMethods(Class<? extends RawEntity<?>> entity,
FieldNameConverter converter)
Gets all the methods of an entity that correspond to a value field. |
|
static Set<String> |
getValueFieldsNames(Class<? extends RawEntity<?>> entity,
FieldNameConverter converter)
|
|
static boolean |
interfaceInheritsFrom(Class<?> type,
Class<?> superType)
|
|
static boolean |
isAccessor(Method method)
|
|
static boolean |
isAnnotatedAsRelational(Method method)
|
|
static boolean |
isAnnotatedMutator(Method method)
|
|
static boolean |
isMutator(Method method)
|
|
static List<String> |
preloadValue(Preload preload,
FieldNameConverter fnc)
|
|
static boolean |
typeInstanceOf(Class<?> type,
Class<?> otherType)
|
|
static String |
where(ManyToMany manyToMany,
FieldNameConverter fnc)
|
|
static String |
where(OneToMany oneToMany,
FieldNameConverter fnc)
|
|
static String |
where(OneToOne oneToOne,
FieldNameConverter fnc)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Common()
Method Detail |
---|
public static <T extends RawEntity<K>,K> T createPeer(EntityManager manager, Class<T> type, K key) throws SQLException
SQLException
public static String convertSimpleClassName(String name)
public static String convertDowncaseName(String name)
public static boolean interfaceInheritsFrom(Class<?> type, Class<?> superType)
public static boolean typeInstanceOf(Class<?> type, Class<?> otherType)
public static String[] getMappingFields(FieldNameConverter converter, Class<? extends RawEntity<?>> from, Class<? extends RawEntity<?>> to)
public static String[] getPolymorphicFieldNames(FieldNameConverter converter, Class<? extends RawEntity<?>> from, Class<? extends RawEntity<?>> to)
public static AnnotationDelegate getAnnotationDelegate(FieldNameConverter converter, Method method)
AnnotationDelegate
objects. Need to
do some research to determine whether or not this is actually
a problem.
public static Method findCounterpart(FieldNameConverter converter, Method method)
null
if no corresponding method).
converter
- TODOpublic static boolean isMutator(Method method)
public static boolean isAnnotatedMutator(Method method)
public static boolean isAccessor(Method method)
public static boolean isAnnotatedAsRelational(Method method)
public static Class<?> getAttributeTypeFromMethod(Method method)
public static String getCallingClassName(int depth)
public static List<String> getSearchableFields(EntityManager manager, Class<? extends RawEntity<?>> type)
public static Method getPrimaryKeyAccessor(Class<? extends RawEntity<?>> type)
public static String getPrimaryKeyField(Class<? extends RawEntity<?>> type, FieldNameConverter converter)
public static Method getPrimaryKeyMethod(Class<? extends RawEntity<?>> type)
public static <K> DatabaseType<K> getPrimaryKeyType(Class<? extends RawEntity<K>> type)
public static <K> Class<K> getPrimaryKeyClassType(Class<? extends RawEntity<K>> type)
public static <K> K getPrimaryKeyValue(RawEntity<K> entity)
public static boolean fuzzyCompare(Object a, Object b)
public static boolean fuzzyTypeCompare(int typeA, int typeB)
public static Set<Method> getValueFieldsMethods(Class<? extends RawEntity<?>> entity, FieldNameConverter converter)
entity
- the entity to look up the methods fromconverter
- the field name converter currently in use for entities
public static Set<String> getValueFieldsNames(Class<? extends RawEntity<?>> entity, FieldNameConverter converter)
public static List<String> preloadValue(Preload preload, FieldNameConverter fnc)
public static String where(OneToOne oneToOne, FieldNameConverter fnc)
public static String where(OneToMany oneToMany, FieldNameConverter fnc)
public static String where(ManyToMany manyToMany, FieldNameConverter fnc)
public static String convert(FieldNameConverter fnc, String column)
public static void closeQuietly(ResultSet resultSet)
ResultSet
in a null
safe manner and quietly, i.e without throwing nor logging
any exception
resultSet
- the result set to closepublic static void closeQuietly(Statement statement)
Statement
in a null
safe manner and quietly, i.e without throwing nor logging
any exception
statement
- the statement to closepublic static void closeQuietly(Connection connection)
Connection
in a null
safe manner and quietly, i.e without throwing nor logging
any exception
connection
- the connection to close, can be null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |