Package org.javalite.activejdbc
Class ModelDelegate
java.lang.Object
org.javalite.activejdbc.ModelDelegate
This class exists to offload some logic from
Model
class.- Author:
- Igor Polevoy: 4/25/12 2:45 AM, Eric Nielsen
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
static List<Association>
associations(Class<? extends Model> clazz)
attributeNames(Class<? extends Model> clazz)
static boolean
static void
blankToNull(Class<? extends Model> clazz, String... attributeNames)
static void
callbackWith(Class<? extends Model> clazz, CallbackListener... listeners)
static void
convertWith(Class<? extends Model> clazz, Converter converter, String... attributeNames)
static Long
static Long
static <T extends Model>
Tstatic <T extends Model>
Tstatic void
dateFormat(Class<? extends Model> clazz, String pattern, String... attributeNames)
static void
dateFormat(Class<? extends Model> clazz, DateFormat format, String... attributeNames)
static int
static int
static boolean
static <T extends Model>
TfindByCompositeKeys(Class<T> clazz, Object... values)
static <T extends Model>
Tstatic <T extends Model>
Tstatic <T extends Model>
TfindOrCreateIt(Class<T> clazz, boolean save, Object... namesAndValues)
static <T extends Model>
TfindOrCreateIt(Class<T> clazz, Object... namesAndValues)
static <T extends Model>
TfindOrInit(Class<T> clazz, Object... namesAndValues)
static <T extends Model, M extends T>
voidfindWith(Class<M> clazz, ModelListener<T> listener, String query, Object... params)
static MetaModel
metaModelFor(String tableName)
ReturnsMetaModel
associated with table name.static MetaModel
metaModelOf(Class<? extends Model> clazz)
ReturnsMetaModel
associated with model class.static void
purgeCache(Class<? extends Model> clazz)
static void
removeValidator(Class<? extends Model> clazz, Validator validator)
static String
tableNameOf(Class<? extends Model> clazz)
static void
timestampFormat(Class<? extends Model> clazz, String pattern, String... attributeNames)
static void
timestampFormat(Class<? extends Model> clazz, DateFormat format, String... attributeNames)
static int
static int
static ValidationBuilder
validateEmailOf(Class<? extends Model> clazz, String attributeName)
static NumericValidationBuilder
validateNumericalityOf(Class<? extends Model> clazz, String... attributeNames)
static ValidationBuilder
validatePresenceOf(Class<? extends Model> clazz, String... attributeNames)
static ValidationBuilder
static ValidationBuilder
validateRegexpOf(Class<? extends Model> clazz, String attributeName, String pattern)
static ValidationBuilder
validateWith(Class<? extends Model> clazz, Validator validator)
validatorsOf(Class<? extends Model> clazz)
static void
zeroToNull(Class<? extends Model> clazz, String... attributeNames)
-
Method Details
-
associations
-
attributeNames
-
belongsTo
-
blankToNull
-
callbackWith
-
convertWith
-
count
-
count
-
create
-
createIt
-
dateFormat
public static void dateFormat(Class<? extends Model> clazz, DateFormat format, String... attributeNames) -
dateFormat
-
delete
-
deleteAll
-
exists
-
findAll
-
findById
-
findByCompositeKeys
-
findBySql
-
findFirst
-
findWith
public static <T extends Model, M extends T> void findWith(Class<M> clazz, ModelListener<T> listener, String query, Object... params) -
metaModelFor
ReturnsMetaModel
associated with table name.- Parameters:
tableName
- name of table.- Returns:
MetaModel
associated with table name
-
metaModelOf
ReturnsMetaModel
associated with model class.- Parameters:
clazz
- model class.- Returns:
MetaModel
associated with table name
-
purgeCache
-
removeValidator
-
tableNameOf
-
timestampFormat
-
timestampFormat
public static void timestampFormat(Class<? extends Model> clazz, DateFormat format, String... attributeNames) -
update
-
updateAll
-
validateEmailOf
public static ValidationBuilder validateEmailOf(Class<? extends Model> clazz, String attributeName) -
validateNumericalityOf
public static NumericValidationBuilder validateNumericalityOf(Class<? extends Model> clazz, String... attributeNames) -
validatorsOf
-
validatePresenceOf
public static ValidationBuilder validatePresenceOf(Class<? extends Model> clazz, String... attributeNames) -
validateRange
-
validateRegexpOf
public static ValidationBuilder validateRegexpOf(Class<? extends Model> clazz, String attributeName, String pattern) -
validateWith
-
where
-
zeroToNull
-
findOrInit
-
findOrCreateIt
-
findOrCreateIt
-
addScope
-