Uses of Class
org.javalite.activejdbc.Model
Package
Description
ActiveJDBC - the agile Java ORM.
Contains classes describing various association types.
JavaLite Async, see JavaLite Async.
-
Uses of Model in org.javalite.activejdbc
Modifier and TypeClassDescriptionclass
CallbackAdapter<T extends Model>
interface
CallbackListener<T extends Model>
class
While this class is public, it is never instantiated directly.interface
ModelListener<T extends Model>
class
This class supports pagination of result sets in ActiveJDBC.static class
Paginator.PaginatorBuilder<T extends Model>
Provides a builder pattern to create new instances of paginator.class
ScopeBuilder<T extends Model>
class
SuperLazyList<T extends Model>
The purpose of this class is to providetoMaps()
method in cases of eager loading of dependencies.Modifier and TypeMethodDescription<T extends Model>
voidConvenience method.ScopeBuilder.all()
Use in case the scopes define all criteria you need.static <T extends Model>
TThis is a convenience method to create a model instance already initialized with values.static <T extends Model>
Tstatic <T extends Model>
TThis is a convenience method tocreate(Object...)
.static <T extends Model>
T<T extends Model>
voidModel.deleteChildrenShallow(Class<T> clazz)
Deletes immediate children (does not walk the dependency tree).Synonym ofwhere(String, Object...)
Model.findAll()
This method returns all records from this table.static <T extends Model>
TModel.findByCompositeKeys(Object... values)
Composite PK values in exactly the same order as specified inCompositePK
.static <T extends Model>
TModelDelegate.findByCompositeKeys(Class<T> clazz, Object... values)
static <T extends Model>
Tstatic <T extends Model>
TFree form query finder.static <T extends Model>
TSynonym offirst(String, Object...)
.static <T extends Model>
Tstatic <T extends Model>
TModel.findOrCreateIt(Object... namesAndValues)
A convenience method to fetch existing model from db or to create and insert new record with attribute values.static <T extends Model>
TModelDelegate.findOrCreateIt(Class<T> clazz, boolean save, Object... namesAndValues)
static <T extends Model>
TModelDelegate.findOrCreateIt(Class<T> clazz, Object... namesAndValues)
static <T extends Model>
TModel.findOrInit(Object... namesAndValues)
A convenience method to fetch existing model from db or to create a new instance in memory initialized with some attribute values.static <T extends Model>
TModelDelegate.findOrInit(Class<T> clazz, Object... namesAndValues)
static <T extends Model, M extends T>
voidModelDelegate.findWith(Class<M> clazz, ModelListener<T> listener, String query, Object... params)
static <T extends Model>
TReturns a first result for this condition.<T extends Model>
TOverrides attribute values from input map.Provides a list of child models in one to many, many to many and polymorphic associations, but in addition also allows to filter this list by criteria.This methods supports one to many, many to many relationships as well as polymorphic associations.This method includes associated objects.static <E extends Model>
Paginator.PaginatorBuilder<E>Paginator.instance()
Use to create a paginator instance, and provide arguments as needed.LazyList.limit(long limit)
This method limits the number of results in the resultset.SuperLazyList.limit(long limit)
LazyList.load()
This method exists to force immediate load from DB.SuperLazyList.load()
LazyList.offset(long offset)
This method sets an offset of a resultset.SuperLazyList.offset(long offset)
Use this method to order results by a column.<P extends Model>
PReturns parent of this model, assuming that this table represents a child.<P extends Model>
PSame asparent(Class)
, with additional argument.static <T extends Model>
ScopeBuilder<T>Allows to specify multiple scopes as filters such as:static <T extends Model>
ScopeBuilder<T>Allows to specify multiple scopes as filters such as:<T extends Model>
TThis is a convenience method to set multiple values to a model.<T extends Model>
TSets a value of an attribute.<T extends Model>
TSets attribute value asjava.sql.Array
.<T extends Model>
TModel.setBigDecimal(String attributeName, Object value)
Sets attribute value asjava.math.BigDecimal
.<T extends Model>
TModel.setBoolean(String attributeName, Object value)
Sets attribute value asBoolean
.<T extends Model>
TSets attribute value asjava.sql.Date
.<T extends Model>
TSets attribute value asDouble
.<T extends Model>
TSets attribute value asFloat
.<T extends Model>
TConvenience method, sets ID value on this model, equivalent toset(getIdName(), id)
.<T extends Model>
TModel.setInteger(String attributeName, Object value)
Sets attribute value asInteger
.<T extends Model>
TModel.setJSONList(String attributeName, JSONList value)
Sets aJSONList
as a value of an attribute.<T extends Model>
TModel.setJSONMap(String attributeName, JSONMap value)
Sets aJSONMap
as a value of an attribute.<T extends Model>
TSets attribute value asLong
.<T extends Model>
TSets attribute value asShort
.<T extends Model>
TSets attribute value asString
.<T extends Model>
TSets attribute value asjava.sql.Time
.<T extends Model>
TModel.setTimestamp(String attributeName, Object value)
Sets attribute value asjava.sql.Timestamp
.Finder method for DB queries based on table represented by this model.Applies additional criteria to scopes defined in the model.Modifier and TypeMethodDescriptionMetaModel.getModelClass()
Registry.getModelClass(String table, boolean suppressException)
Returns model class for a table name, null if not found.ModelFinder.getModelsForDb(String dbName)
Modifier and TypeMethodDescriptionvoid
Adds a new child dependency.void
Copies all attribute values (except for ID, created_at and updated_at) from other instance to this one.void
Copies all attribute values (except for ID, created_at and updated_at) from this instance to the other.int
Removes associated child from this instance.protected void
Model.setCachedParent(Model parent)
void
Sets a parent on this instance.void
Model.setParents(Model... parents)
Sets multiple parents on this instance.Modifier and TypeMethodDescriptionstatic List<Association>
ModelDelegate.associations(Class<? extends Model> clazz)
ModelDelegate.attributeNames(Class<? extends Model> clazz)
static boolean
static boolean
static void
ModelDelegate.blankToNull(Class<? extends Model> clazz, String... attributeNames)
static void
ModelDelegate.callbackWith(Class<? extends Model> clazz, CallbackListener... listeners)
static void
ModelDelegate.convertWith(Class<? extends Model> clazz, Converter converter, String... attributeNames)
static Long
static Long
static void
ModelDelegate.dateFormat(Class<? extends Model> clazz, String pattern, String... attributeNames)
static void
ModelDelegate.dateFormat(Class<? extends Model> clazz, DateFormat format, String... attributeNames)
static int
static int
static boolean
<A extends Association>
AMetaModel.getAssociationForTarget(Class<? extends Model> targetClass)
Returns association of this table with the target table.<A extends Association>
AMetaModel.getAssociationForTarget(Class<? extends Model> targetModelClass, Class<A> associationClass)
Returns association of this table with the target table.MetaModel.getAssociationsForTarget(Class<? extends Model> targetModelClass)
Returns associations of this table with the target table.protected static String
Registry.getMetaModel(Class<? extends Model> modelClass)
protected String
Registry.getTableName(Class<? extends Model> modelClass)
Model.getValidators(Class<? extends Model> clazz)
protected boolean
MetaModel.hasAssociation(Class<? extends Model> targetClass, Class<? extends Association> associationClass)
boolean
MetaModel.isAssociatedTo(Class<? extends Model> targetModelClass)
Checks if there is association to the target model class.,static MetaModel
ModelDelegate.metaModelOf(Class<? extends Model> clazz)
ReturnsMetaModel
associated with model class.static void
ModelDelegate.purgeCache(Class<? extends Model> clazz)
void
MetaModel.removeAssociationForTarget(Class<? extends Model> modelClass)
static void
ModelDelegate.removeValidator(Class<? extends Model> clazz, Validator validator)
protected void
Model.setChildren(Class childClass, List<Model> children)
static String
ModelDelegate.tableNameOf(Class<? extends Model> clazz)
static void
ModelDelegate.timestampFormat(Class<? extends Model> clazz, String pattern, String... attributeNames)
static void
ModelDelegate.timestampFormat(Class<? extends Model> clazz, DateFormat format, String... attributeNames)
static int
ModelDelegate.update(Class<? extends Model> clazz, String updates, String conditions, Object... params)
static int
static ValidationBuilder
ModelDelegate.validateEmailOf(Class<? extends Model> clazz, String attributeName)
static NumericValidationBuilder
ModelDelegate.validateNumericalityOf(Class<? extends Model> clazz, String... attributeNames)
static ValidationBuilder
ModelDelegate.validatePresenceOf(Class<? extends Model> clazz, String... attributeNames)
static ValidationBuilder
ModelDelegate.validateRange(Class<? extends Model> clazz, String attributeName, Number min, Number max)
static ValidationBuilder
ModelDelegate.validateRegexpOf(Class<? extends Model> clazz, String attributeName, String pattern)
static ValidationBuilder
ModelDelegate.validateWith(Class<? extends Model> clazz, Validator validator)
ModelDelegate.validatorsOf(Class<? extends Model> clazz)
static void
ModelDelegate.zeroToNull(Class<? extends Model> clazz, String... attributeNames)
-
Uses of Model in org.javalite.activejdbc.associations
Modifier and TypeMethodDescriptionAssociation.getSourceClass()
Returns source class of this association.Association.getTargetClass()
Returns target class of this association.ModifierConstructorDescriptionprotected
Association(Class<? extends Model> source, Class<? extends Model> target)
BelongsToPolymorphicAssociation(Class<? extends Model> sourceModelClass, Class<? extends Model> targetModelClass, String typeLabel, String parentClassName)
Many2ManyAssociation(Class<? extends Model> sourceModelClass, Class<? extends Model> targetModelClass, String join, String sourceFkName, String targetFkName)
Many2ManyAssociation(Class<? extends Model> source, Class<? extends Model> target, String join, String sourceFkName, String targetFkName, String targetPk)
NotAssociatedException(Class<? extends Model> sourceClass, Class<? extends Model> targetClass)
OneToManyAssociation(Class<? extends Model> sourceModelClass, Class<? extends Model> targetModelClass, String fkName)
OneToManyPolymorphicAssociation(Class<? extends Model> source, Class<? extends Model> target, String typeLabel)
-
Uses of Model in org.javalite.async