|
exedio cope | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.exedio.cope.Type<C>
public final class Type<C extends Item>
| Nested Class Summary | |
|---|---|
static class |
Type.This<E extends Item>
|
| Method Summary | ||
|---|---|---|
|
as(Class<X> clazz)
|
|
C |
cast(Item item)
|
|
|
castType(Class<X> clazz)
Deprecated. Use as(Class) instead |
|
int |
checkPrimaryKey()
|
|
static
|
findByJavaClass(Class<X> javaClass)
Deprecated. Use forClass(Class) instead |
|
static Type<?> |
findByJavaClassUnchecked(Class<?> javaClass)
Deprecated. Use forClassUnchecked(Class) instead |
|
static
|
forClass(Class<X> javaClass)
|
|
static Type<?> |
forClassUnchecked(Class<?> javaClass)
|
|
|
getAnnotation(Class<T> annotationClass)
|
|
List<Field> |
getAttributes()
Deprecated. Renamed to getFields(). |
|
List<CopyConstraint> |
getCopyConstraints()
|
|
List<Field> |
getDeclaredAttributes()
Deprecated. Renamed to getDeclaredFields(). |
|
List<CopyConstraint> |
getDeclaredCopyConstraints()
|
|
Feature |
getDeclaredFeature(String name)
|
|
List<Feature> |
getDeclaredFeatures()
|
|
List<Field> |
getDeclaredFields()
Returns the list of persistent fields declared by the this type. |
|
List<ItemField<C>> |
getDeclaredReferences()
Returns all ItemFields of the model this type belongs to,
which value type equals this type. |
|
List<UniqueConstraint> |
getDeclaredUniqueConstraints()
|
|
Feature |
getFeature(String name)
|
|
List<Feature> |
getFeatures()
|
|
List<Field> |
getFields()
Returns the list of accessible persistent fields of this type. |
|
String |
getID()
|
|
Class<C> |
getJavaClass()
|
|
Model |
getModel()
|
|
Pattern |
getPattern()
|
|
String |
getPrimaryKeyColumnName()
Deprecated. Use SchemaInfo.getPrimaryKeyColumnName(Type) instead |
|
SequenceInfo |
getPrimaryKeyInfo()
|
|
List<ItemField> |
getReferences()
Returns all ItemFields of the model this type belongs to,
which value type equals this type
or any of it's super types. |
|
List<Type<? extends C>> |
getSubTypes()
|
|
List<Type<? extends C>> |
getSubTypesTransitively()
|
|
Type<? super C> |
getSupertype()
Returns the type representing the superclass
of this type's java class. |
|
String |
getTableName()
Deprecated. Use SchemaInfo.getTableName(Type) instead |
|
Type.This<C> |
getThis()
|
|
String |
getTypeColumnName()
Deprecated. Use SchemaInfo.getTypeColumnName(Type) instead |
|
List<Type<? extends C>> |
getTypesOfInstances()
Returns a list of types, that instances (items) of this type can have. |
|
List<UniqueConstraint> |
getUniqueConstraints()
|
|
boolean |
hasUniqueJavaClass()
Returns, whether this type has a java class uniquely for this type. |
|
boolean |
isAbstract()
|
|
boolean |
isAssignableFrom(Type type)
|
|
C |
newItem(SetValue... setValues)
|
|
ItemField<C> |
newItemField(ItemField.DeletePolicy policy)
|
|
Query<C> |
newQuery()
|
|
Query<C> |
newQuery(Condition condition)
|
|
List<C> |
search()
Searches for all items of this type. |
|
List<C> |
search(Condition condition)
Searches for items of this type, that match the given condition. |
|
List<C> |
search(Condition condition,
Function orderBy,
boolean ascending)
Searches for items of this type, that match the given condition. |
|
C |
searchSingleton(Condition condition)
Searches equivalently to search(Condition),
but assumes that the condition forces the search result to have at most one element. |
|
C |
searchSingletonStrict(Condition condition)
Searches equivalently to search(Condition),
but assumes that the condition forces the search result to have exactly one element. |
|
C |
searchUnique(Condition condition)
Deprecated. renamed to searchSingleton(Condition). |
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static final <X extends Item> Type<X> forClass(Class<X> javaClass)
IllegalArgumentException - if there is no type for the given java class.hasUniqueJavaClass()public <X extends Item> Type<X> as(Class<X> clazz)
public static final Type<?> forClassUnchecked(Class<?> javaClass)
IllegalArgumentException - if there is no type for the given java class.hasUniqueJavaClass()public <T extends java.lang.annotation.Annotation> T getAnnotation(Class<T> annotationClass)
Class.getAnnotation(Class)public Class<C> getJavaClass()
public boolean hasUniqueJavaClass()
forClass(Class) and
forClassUnchecked(Class).
public String getID()
Model.getType(String)public Model getModel()
public List<Type<? extends C>> getTypesOfInstances()
public SequenceInfo getPrimaryKeyInfo()
public int checkPrimaryKey()
public Type<? super C> getSupertype()
superclass
of this type's java class.
If this type has no super type
(i.e. the superclass of this type's java class is Item),
then null is returned.
public List<Type<? extends C>> getSubTypes()
getSubTypesTransitively()public List<Type<? extends C>> getSubTypesTransitively()
getSubTypes()public boolean isAssignableFrom(Type type)
public boolean isAbstract()
public Type.This<C> getThis()
public List<ItemField<C>> getDeclaredReferences()
ItemFields of the model this type belongs to,
which value type equals this type.
getReferences()public List<ItemField> getReferences()
ItemFields of the model this type belongs to,
which value type equals this type
or any of it's super types.
getDeclaredReferences()public List<Field> getDeclaredFields()
If you want to get all persistent fields of this type,
including fields inherited from super types,
use getFields().
Naming of this method is inspired by Java Reflection API
method getDeclaredFields.
public List<Field> getFields()
If you want to get persistent fields declared by this type only,
excluding fields inherited from super types,
use getDeclaredFields().
public List<Feature> getDeclaredFeatures()
public List<Feature> getFeatures()
public Feature getDeclaredFeature(String name)
public Feature getFeature(String name)
public List<UniqueConstraint> getDeclaredUniqueConstraints()
public List<UniqueConstraint> getUniqueConstraints()
public List<CopyConstraint> getDeclaredCopyConstraints()
public List<CopyConstraint> getCopyConstraints()
public Pattern getPattern()
Pattern.getSourceTypes()public ItemField<C> newItemField(ItemField.DeletePolicy policy)
public C newItem(SetValue... setValues)
throws ConstraintViolationException
ConstraintViolationExceptionpublic C cast(Item item)
public List<C> search()
Returns an unmodifiable collection. Any attempts to modify the returned collection, whether direct or via its iterator, result in an UnsupportedOperationException.
public List<C> search(Condition condition)
Returns an unmodifiable collection. Any attempts to modify the returned collection, whether direct or via its iterator, result in an UnsupportedOperationException.
condition - the condition the searched items must match.
public List<C> search(Condition condition,
Function orderBy,
boolean ascending)
Returns an unmodifiable collection. Any attempts to modify the returned collection, whether direct or via its iterator, result in an UnsupportedOperationException.
condition - the condition the searched items must match.ascending - whether the result is sorted ascendingly (true) or descendingly (false).public C searchSingleton(Condition condition)
search(Condition),
but assumes that the condition forces the search result to have at most one element.
Returns null, if the search result is empty,
returns the only element of the search result,
if the result size is exactly one.
IllegalArgumentException - if the search result size is greater than one.Query.searchSingleton(),
searchSingletonStrict(Condition)public C searchSingletonStrict(Condition condition)
search(Condition),
but assumes that the condition forces the search result to have exactly one element.
Returns the only element of the search result,
if the result size is exactly one.
IllegalArgumentException - if the search result size is not exactly one.Query.searchSingletonStrict(),
searchSingleton(Condition)public Query<C> newQuery()
public Query<C> newQuery(Condition condition)
public String toString()
toString in class Object@Deprecated public static final <X extends Item> Type<X> findByJavaClass(Class<X> javaClass)
forClass(Class) instead
@Deprecated public static final Type<?> findByJavaClassUnchecked(Class<?> javaClass)
forClassUnchecked(Class) instead
@Deprecated public String getTableName()
SchemaInfo.getTableName(Type) instead
@Deprecated public String getPrimaryKeyColumnName()
SchemaInfo.getPrimaryKeyColumnName(Type) instead
@Deprecated public String getTypeColumnName()
SchemaInfo.getTypeColumnName(Type) instead
@Deprecated public List<Field> getDeclaredAttributes()
getDeclaredFields().
@Deprecated public List<Field> getAttributes()
getFields().
@Deprecated public C searchUnique(Condition condition)
searchSingleton(Condition).
@Deprecated public <X extends Item> Type<X> castType(Class<X> clazz)
as(Class) instead
|
Cope with Object Persistence |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||