Class Type<T extends Item>
- All Implemented Interfaces:
AbstractType<T>
,Serializable
,Comparable<Type<?>>
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Deprecated.Useas(Class)
insteadcastTypeExtends
(Type<?> subtype) int
checkCompleteness
(Type<? extends T> subType) Deprecated.UsecheckCompletenessL(Type)
insteadlong
checkCompletenessL
(Type<? extends T> subType) int
Deprecated.UsecheckUpdateCounter()
insteadint
Deprecated.UsecheckSequenceBehindPrimaryKey()
.isBehindBy
() insteadint
Deprecated.UsecheckUpdateCounterL()
insteadlong
int
findByJavaClass
(Class<X> javaClass) Deprecated.UseforClass(Class)
insteadstatic Type<?>
findByJavaClassUnchecked
(Class<? extends Item> javaClass) Deprecated.UseforClassUnchecked(Class)
insteadDeprecated.UseTypesBound.forClass(Class)
instead.static Type<?>
forClassUnchecked
(Class<? extends Item> javaClass) Deprecated.UseTypesBound.forClassUnchecked(Class)
instead.<A extends Annotation>
AgetAnnotation
(Class<A> annotationClass) Deprecated.Renamed togetFields()
.List<? extends CheckConstraint>
List<? extends CopyConstraint>
long
Deprecated.Renamed togetDeclaredFields()
.List<? extends CheckConstraint>
List<? extends CopyConstraint>
getDeclaredFeature
(String name) Returns the list of persistent fields declared by the this type.Returns allItemField
s of the model this type belongs to, whichvalue type
equals this type.List<? extends UniqueConstraint>
getFeature
(String name) Returns the list of accessible persistent fields of this type.getID()
Returns the id of this type.getModel()
Deprecated.UseSchemaInfo.getPrimaryKeyColumnName(Type)
insteadReturns allItemField
s of the model this type belongs to, whichvalue type
equals this type or any of it's super types.Returns all types whosesuper type
is this type.Deprecated.UsegetSubtypes()
insteadReturns a list of allsubtypes
and all subtypes of the subtypes etc.Deprecated.UsegetSubtypesTransitively()
insteadReturns the type representing thesuperclass
of this type'sjava class
.Deprecated.UseSchemaInfo.getTableName(Type)
insteadgetThis()
Deprecated.UseSchemaInfo.getTypeColumnName(Type)
insteadReturns a list of types, that instances (items) of this type can have.List<? extends UniqueConstraint>
boolean
Deprecated.UseisBound()
insteadboolean
boolean
isAnnotationPresent
(Class<? extends Annotation> annotationClass) boolean
isAssignableFrom
(Type<?> type) boolean
isBound()
Returns, whether this type bound to it's java class.boolean
Deprecated.UseisBound()
insteadboolean
Deprecated.UseneedsCheckUpdateCounter()
insteadboolean
newItemField
(ItemField.DeletePolicy policy) newQuery()
random
(int seed) search()
Searches for all items of this type.Searches for items of this type, that match the given condition.Searches for items of this type, that match the given condition.searchSingleton
(Condition condition) Searches equivalently tosearch(Condition)
, but assumes that the condition forces the search result to have at most one element.searchSingletonStrict
(Condition condition) Searches equivalently tosearch(Condition)
, but assumes that the condition forces the search result to have exactly one element.searchUnique
(Condition condition) Deprecated.renamed tosearchSingleton(Condition)
.toString()
-
Method Details
-
as
-
asExtends
- See Also:
-
asSuper
- See Also:
-
isAnnotationPresent
- See Also:
-
getAnnotation
- See Also:
-
getJavaClass
- Specified by:
getJavaClass
in interfaceAbstractType<T extends Item>
-
isBound
public boolean isBound()Returns, whether this type bound to it's java class. Only such types can be found byTypesBound.forClass(Class)
andTypesBound.forClassUnchecked(Class)
. -
getID
Returns the id of this type. Type ids are unique within amodel
. UseModel.getType(String)
for lookup. -
getModel
-
getTypesOfInstances
Returns a list of types, that instances (items) of this type can have. These are all subtypes of this type, including indirect subtypes, and including this type itself, which are not abstract. -
getPrimaryKeyInfo
-
checkPrimaryKey
Deprecated.UsecheckSequenceBehindPrimaryKey()
.isBehindBy
() instead- Throws:
IllegalStateException
- is a transaction is bound to the current thread
-
checkSequenceBehindPrimaryKey
- Throws:
IllegalStateException
- is a transaction is bound to the current thread
-
getSupertype
Returns the type representing thesuperclass
of this type'sjava class
. If this type has no super type (i.e. the superclass of this type's java class isItem
), then null is returned.- Specified by:
getSupertype
in interfaceAbstractType<T extends Item>
-
getSubtypes
Returns all types whosesuper type
is this type.- Specified by:
getSubtypes
in interfaceAbstractType<T extends Item>
- See Also:
-
getSubtypesTransitively
Returns a list of allsubtypes
and all subtypes of the subtypes etc. The result includes this type as well, as any type is its own zeroth-order subtype.- See Also:
-
isAssignableFrom
-
castTypeExtends
- See Also:
-
isAbstract
public boolean isAbstract() -
getThis
-
getDeclaredReferences
Returns allItemField
s of the model this type belongs to, whichvalue type
equals this type.- See Also:
-
getReferences
Returns allItemField
s of the model this type belongs to, whichvalue type
equals this type or any of it's super types.- See Also:
-
getDeclaredFields
Returns the list of persistent fields declared by the this type. This excludes inherited fields. The elements in the list returned are ordered by their occurance in the source code. This method returns an empty list if the type declares no fields.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
. -
getFields
Returns the list of accessible persistent fields of this type. This includes inherited fields. The elements in the list returned are ordered by their type, with types higher in type hierarchy coming first, and within each type by their occurance in the source code. This method returns an empty list if the type has no accessible fields.If you want to get persistent fields declared by this type only, excluding fields inherited from super types, use
getDeclaredFields()
. -
getDeclaredFeatures
- Specified by:
getDeclaredFeatures
in interfaceAbstractType<T extends Item>
-
getFeatures
- Specified by:
getFeatures
in interfaceAbstractType<T extends Item>
-
getDeclaredFeature
- Specified by:
getDeclaredFeature
in interfaceAbstractType<T extends Item>
-
getFeature
- Specified by:
getFeature
in interfaceAbstractType<T extends Item>
-
getLocalizationKeys
- Specified by:
getLocalizationKeys
in interfaceAbstractType<T extends Item>
- See Also:
-
getDeclaredUniqueConstraints
-
getUniqueConstraints
-
getDeclaredCheckConstraints
-
getCheckConstraints
-
getDeclaredCopyConstraints
-
getCopyConstraints
-
getPattern
- See Also:
-
newItemField
-
getCreateLimit
public long getCreateLimit()- See Also:
-
newItem
-
newItem
-
cast
-
search
Searches for all items of this type.Returns an unmodifiable collection. Any attempts to modify the returned collection, whether direct or via its iterator, result in an
UnsupportedOperationException
. -
search
Searches for items of this type, that match the given condition.Returns an unmodifiable collection. Any attempts to modify the returned collection, whether direct or via its iterator, result in an
UnsupportedOperationException
.- Parameters:
condition
- the condition the searched items must match.
-
search
Searches for items of this type, that match the given condition. The result is sorted by the given functionorderBy
.Returns an unmodifiable collection. Any attempts to modify the returned collection, whether direct or via its iterator, result in an
UnsupportedOperationException
.- Parameters:
condition
- the condition the searched items must match.ascending
- whether the result is sorted ascendingly (true</tt>) or descendingly (<tt>false
).
-
searchSingleton
Searches equivalently tosearch(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 resultsize
is exactly one.- Throws:
IllegalArgumentException
- if the search result size is greater than one.- See Also:
-
searchSingletonStrict
Searches equivalently tosearch(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.- Throws:
IllegalArgumentException
- if the search result size is not exactly one.- See Also:
-
newQuery
-
newQuery
-
emptyQuery
-
compareTo
- Specified by:
compareTo
in interfaceComparable<T extends Item>
-
toString
-
checkCompletenessL
- Parameters:
subType
- is allowed any type fromgetTypesOfInstances()
, but not itself.
-
needsCheckUpdateCounter
public boolean needsCheckUpdateCounter() -
checkUpdateCounterL
public long checkUpdateCounterL() -
random
-
checkUpdateCounter
Deprecated.UsecheckUpdateCounterL()
instead -
checkCompleteness
Deprecated.UsecheckCompletenessL(Type)
instead -
asSubtype
Deprecated.UsecastTypeExtends(Type)
instead -
findByJavaClass
Deprecated.UseforClass(Class)
instead -
findByJavaClassUnchecked
Deprecated.UseforClassUnchecked(Class)
instead -
getTableName
Deprecated.UseSchemaInfo.getTableName(Type)
instead -
getPrimaryKeyColumnName
Deprecated.UseSchemaInfo.getPrimaryKeyColumnName(Type)
instead -
getTypeColumnName
Deprecated.UseSchemaInfo.getTypeColumnName(Type)
instead -
getDeclaredAttributes
Deprecated.Renamed togetDeclaredFields()
. -
getAttributes
Deprecated.Renamed togetFields()
. -
searchUnique
Deprecated.renamed tosearchSingleton(Condition)
. -
castType
Deprecated.Useas(Class)
instead -
hasUniqueJavaClass
Deprecated.UseisBound()
instead -
getSubTypes
Deprecated.UsegetSubtypes()
instead -
getSubTypesTransitively
Deprecated.UsegetSubtypesTransitively()
instead -
isJavaClassExclusive
Deprecated.UseisBound()
instead -
forClass
Deprecated.UseTypesBound.forClass(Class)
instead. -
forClassUnchecked
Deprecated.UseTypesBound.forClassUnchecked(Class)
instead. -
needsCheckModificationCounter
Deprecated.UseneedsCheckUpdateCounter()
instead -
checkModificationCounter
Deprecated.UsecheckUpdateCounter()
instead
-
castTypeExtends(Type)
instead