Package com.exedio.cope
Class ItemField<E extends Item>
- java.lang.Object
-
- com.exedio.cope.Feature
-
- com.exedio.cope.Field<E>
-
- com.exedio.cope.FunctionField<E>
-
- com.exedio.cope.ItemField<E>
-
- All Implemented Interfaces:
Copyable
,Function<E>
,ItemFunction<E>
,Selectable<E>
,Settable<E>
,Serializable
public final class ItemField<E extends Item> extends FunctionField<E> implements ItemFunction<E>
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ItemField.DeletePolicy
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
appendSelect(com.exedio.cope.Statement bf, Join join)
Deprecated.For internal use within COPE only.void
appendType(com.exedio.cope.Statement bf, Join join)
Deprecated.For internal use within COPE only.<X extends Item>
ItemField<X>as(Class<X> clazz)
<X extends Item>
ItemField<? extends X>asExtends(Class<X> clazz)
<X extends Item>
ItemField<? super X>asSuper(Class<X> clazz)
ItemField<E>
cascade()
<X extends Item>
ItemField<X>cast(Class<X> clazz)
Deprecated.Useas(Class)
insteadint
checkTypeColumn()
Deprecated.long
checkTypeColumnL()
ItemField<E>
choice(String backPointerName)
Causes this ItemField to create achoice constraint
.ItemField<E>
copy()
ItemField<E>
copyFrom(ItemField<?> copyFrom)
ItemField<E>
copyTo(FunctionField<?> copyTo)
static <E extends Item>
ItemField<E>create(Class<E> valueClass)
static <E extends Item>
ItemField<E>create(Class<E> valueClass, ItemField.DeletePolicy policy)
static <E extends Item>
ItemField<E>create(Class<E> valueClass, TypeFuture<E> valueType, ItemField.DeletePolicy policy)
ItemField<E>
defaultTo(E defaultConstant)
Deprecated.defaults make no sense for ItemFieldCopyConstraint
getChoice()
ItemField.DeletePolicy
getDeletePolicy()
String
getTypeColumnName()
Deprecated.UseSchemaInfo.getTypeColumnName(ItemField)
insteadType<E>
getValueType()
Returns the type of items, this field accepts instances of.Type<E>
getValueType(Model model)
Returns the same value asgetValueType()
for the model this field (and itstype
) is part of.boolean
needsCheckTypeColumn()
ItemField<E>
noCopyFrom()
Returns a new FunctionField that differs from this FunctionField by having nocopyFrom
fields set.ItemField<E>
noDefault()
ItemField<E>
nonUnique()
ItemField<E>
nullify()
Additionally makes the fieldoptional
.ItemField<E>
optional()
Returns a new Field, that differs from this Field by being optional.ItemField<E>
toFinal()
Returns a new Field, that differs from this Field by being final.ItemField<E>
unique()
Returns a new FunctionField, that differs from this FunctionField by being unique.-
Methods inherited from class com.exedio.cope.FunctionField
addCopyFrom, append, check, copy, copyFunctionField, get, get, getDefaultConstant, getImplicitCopyConstraint, getImplicitCopyConstraints, getImplicitUniqueConstraint, getInitialExceptions, getUniqueConstraints, hasDefault, isInitial, isRedundantByCopyConstraint, searchUnique, searchUnique, searchUniqueStrict, set
-
Methods inherited from class com.exedio.cope.Field
castCollection, check, execute, getColumnName, getInitialType, getPatterns, getValueClass, isFinal, isMandatory, mapNull
-
Methods inherited from class com.exedio.cope.Feature
afterModelCreated, getAbstractType, getAnnotation, getID, getLocalizationKeys, getName, getPattern, getType, isAnnotationPresent, isSourceAlready, mount, readResolve, requireMounted, toString, toString, writeReplace
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.exedio.cope.Function
any, between, equal, equal, equal, get, get, greater, greater, greaterOrEqual, greaterOrEqual, in, in, isNotNull, isNull, less, less, lessOrEqual, lessOrEqual, max, min, notEqual, notEqual
-
Methods inherited from interface com.exedio.cope.ItemFunction
bind, equalTarget, equalTarget, instanceOf, instanceOf, instanceOf, instanceOf, instanceOf, notInstanceOf, notInstanceOf, notInstanceOf, notInstanceOf, notInstanceOf, typeIn, typeIn, typeIn, typeIn, typeIn, typeNotIn, typeNotIn, typeNotIn, typeNotIn, typeNotIn
-
Methods inherited from interface com.exedio.cope.Selectable
append, check, getType, getValueClass, toString
-
-
-
-
Method Detail
-
create
public static <E extends Item> ItemField<E> create(Class<E> valueClass, ItemField.DeletePolicy policy)
-
create
public static <E extends Item> ItemField<E> create(Class<E> valueClass, TypeFuture<E> valueType, ItemField.DeletePolicy policy)
-
toFinal
public ItemField<E> toFinal()
Description copied from class:Field
Returns a new Field, that differs from this Field by being final. If this Field is already final, the the result is equal to this Field.- Specified by:
toFinal
in classFunctionField<E extends Item>
- See Also:
Field.isFinal()
-
optional
public ItemField<E> optional()
Description copied from class:Field
Returns a new Field, that differs from this Field by being optional. If this Field is already optional, the the result is equal to this Field.- Specified by:
optional
in classFunctionField<E extends Item>
- See Also:
Field.isMandatory()
-
unique
public ItemField<E> unique()
Description copied from class:FunctionField
Returns a new FunctionField, that differs from this FunctionField by being unique. If this FunctionField is already unique, the the result is equal to this FunctionField.- Specified by:
unique
in classFunctionField<E extends Item>
- See Also:
FunctionField.getImplicitUniqueConstraint()
-
nonUnique
public ItemField<E> nonUnique()
- Specified by:
nonUnique
in classFunctionField<E extends Item>
-
copyFrom
public ItemField<E> copyFrom(ItemField<?> copyFrom)
- Specified by:
copyFrom
in classFunctionField<E extends Item>
- See Also:
copyTo(FunctionField)
-
copyTo
public ItemField<E> copyTo(FunctionField<?> copyTo)
- See Also:
FunctionField.copyFrom(ItemField)
-
noCopyFrom
public ItemField<E> noCopyFrom()
Description copied from class:FunctionField
Returns a new FunctionField that differs from this FunctionField by having nocopyFrom
fields set.- Specified by:
noCopyFrom
in classFunctionField<E extends Item>
-
choice
public ItemField<E> choice(String backPointerName)
Causes this ItemField to create achoice constraint
.This ItemField becomes the
target
of the copy constraint. The field pointing back becomes thetemplate
, andType.getThis()
of the type of this ItemField becomes thecopy
.- Parameters:
backPointerName
- the name of the field pointing back; atE
, this has to be the name of anItemField
where thevalue type
overlaps with this item field'sFeature.getType()
-
noDefault
public ItemField<E> noDefault()
- Specified by:
noDefault
in classFunctionField<E extends Item>
-
defaultTo
@Deprecated public ItemField<E> defaultTo(E defaultConstant)
Deprecated.defaults make no sense for ItemField- Specified by:
defaultTo
in classFunctionField<E extends Item>
-
getChoice
public CopyConstraint getChoice()
-
asExtends
public <X extends Item> ItemField<? extends X> asExtends(Class<X> clazz)
- See Also:
as(Class)
,Class.asSubclass(Class)
-
getDeletePolicy
public ItemField.DeletePolicy getDeletePolicy()
-
getValueType
public Type<E> getValueType()
Returns the type of items, this field accepts instances of.- Specified by:
getValueType
in interfaceItemFunction<E extends Item>
- Specified by:
getValueType
in interfaceSelectable<E extends Item>
-
getValueType
public Type<E> getValueType(Model model)
Returns the same value asgetValueType()
for the model this field (and itstype
) is part of. For other models it returns the same value asgetValueType()
if this field (and itstype
) had been added to that model.
-
appendSelect
@Deprecated public void appendSelect(com.exedio.cope.Statement bf, Join join)
Deprecated.For internal use within COPE only.- Specified by:
appendSelect
in interfaceSelectable<E extends Item>
- Overrides:
appendSelect
in classFunctionField<E extends Item>
-
appendType
@Deprecated public void appendType(com.exedio.cope.Statement bf, Join join)
Deprecated.For internal use within COPE only.- Specified by:
appendType
in interfaceItemFunction<E extends Item>
-
needsCheckTypeColumn
public boolean needsCheckTypeColumn()
- Specified by:
needsCheckTypeColumn
in interfaceItemFunction<E extends Item>
- See Also:
ItemFunction.checkTypeColumn()
-
checkTypeColumnL
public long checkTypeColumnL()
- Specified by:
checkTypeColumnL
in interfaceItemFunction<E extends Item>
- See Also:
ItemFunction.needsCheckTypeColumn()
-
checkTypeColumn
@Deprecated public int checkTypeColumn()
Deprecated.- Specified by:
checkTypeColumn
in interfaceItemFunction<E extends Item>
-
cast
@Deprecated public <X extends Item> ItemField<X> cast(Class<X> clazz)
Deprecated.Useas(Class)
instead
-
getTypeColumnName
@Deprecated public String getTypeColumnName()
Deprecated.UseSchemaInfo.getTypeColumnName(ItemField)
instead
-
-