public class GcPersistableHelper extends Object
Constructor and Description |
---|
GcPersistableHelper() |
Modifier and Type | Method and Description |
---|---|
static String |
columnName(Field field)
Get the name of the column to store the field value in from the Persistable annotation or field name.
|
static List<Field> |
compoundPrimaryKeyFields(Class<? extends Object> clazz)
Get the fields that have been specified as compound primary key fields.
|
static boolean |
defaultUpdate(Class<? extends Object> clazz)
If the table is like a status table and default to update
|
static GcPersistableField |
findPersistableAnnotation(Field field)
Find the Persistable annotation on the field, return null if there is not one.
|
static GcPersistableClass |
findPersistableClassAnnotation(Class<? extends Object> clazz)
Find the PersistableClass annotation on the class, or parent classes, return null if there is not one.
|
static boolean |
hasPersistableAnnotation(Class<? extends Object> clazz)
Whether the class has at least one Persistable(Field or Class) annnotation on the class itself or on any field.
|
static List<Field> |
heirarchicalFields(Class<?> clazz)
A list of heirachical fields from the entire object structure.
|
static boolean |
isCompoundPrimaryKey(Field field)
Whether the field is a compound primary key, check Persistable annotation if there is one on the field, default false.
|
static boolean |
isPersist(Field field,
Class<?> clazz)
Whether the field should be persisted to the database, check Persistable field and class level annotations.
|
static boolean |
isPrimaryKey(Field field)
Whether the field is a primary key, check Persistable annotation if there is one on the field, default false.
|
static boolean |
isSelect(Field field,
Class<?> clazz)
Whether the field should be selected from the database, check Persistable field and class level annotations.
|
static String |
oracleStandardNameFromJava(String javaName)
Get the oracle underscore name e.g.
|
static Field |
primaryKeyField(Class<? extends Object> clazz)
Get the field that has been specified as the primary key - will return null if the class has compound column primary keys.
|
static boolean |
primaryKeyManuallyAssigned(Field primaryKeyField)
Whether the primary key is manually assigned.
|
static String |
primaryKeySequenceName(Field primaryKeyField)
Get the sequence name for the primary key field.
|
static String |
tableName(Class<? extends Object> clazz)
Get the name of the database table to store the object in from the Persistable annotation or the class name.
|
public static String oracleStandardNameFromJava(String javaName)
javaName
- is the java convention name.public static String columnName(Field field)
field
- is the field to get the name from.public static boolean isPrimaryKey(Field field)
field
- is the field to check.public static boolean isCompoundPrimaryKey(Field field)
field
- is the field to check.public static String tableName(Class<? extends Object> clazz)
clazz
- is the field to check.public static boolean defaultUpdate(Class<? extends Object> clazz)
clazz
- is the field to check.public static boolean hasPersistableAnnotation(Class<? extends Object> clazz)
clazz
- is the field to check.public static List<Field> heirarchicalFields(Class<?> clazz)
clazz
- is the child class.public static boolean isSelect(Field field, Class<?> clazz)
field
- is the field to check.clazz
- is teh type of object we are checking.public static boolean isPersist(Field field, Class<?> clazz)
field
- is the field to check.clazz
- is teh type of object we are checking.public static GcPersistableClass findPersistableClassAnnotation(Class<? extends Object> clazz)
clazz
- is the class to find it on.public static GcPersistableField findPersistableAnnotation(Field field)
field
- is the field to find it on.public static Field primaryKeyField(Class<? extends Object> clazz)
clazz
- is the class to check for the field on.public static List<Field> compoundPrimaryKeyFields(Class<? extends Object> clazz)
clazz
- is the class to check for the field on.public static String primaryKeySequenceName(Field primaryKeyField)
primaryKeyField
- is the field with the annotation for primary key and sequence on it.public static boolean primaryKeyManuallyAssigned(Field primaryKeyField)
primaryKeyField
- is the field with the annotation for primary key and sequence on it.Copyright © 2016 Internet2. All rights reserved.