Class OptionalReference<E extends IEntity>
java.lang.Object
ch.nolix.system.objectdata.model.AbstractField
ch.nolix.system.objectdata.model.AbstractBaseReference<E>
ch.nolix.system.objectdata.model.OptionalReference<E>
- Type Parameters:
E- is the type of theIEntityaOptionalReferencecan reference.
- All Implemented Interfaces:
INameHolder, IDatabaseComponent<IDatabase>, IEntityComponent<IEntity>, ITableComponent<ITable<? extends IEntity>>, MandatorynessRequestable, CloseStateRequestable, Clearable, EmptinessRequestable, StateRequestable<DatabaseObjectState>, IDatabaseObject, CreationRequestable, DatabaseConnectionRequestable, DeletionRequestable, EditingRequestable, LoadingRequestable, IBaseReference, IField, IOptionalReference<E>
public final class OptionalReference<E extends IEntity>
extends AbstractBaseReference<E>
implements IOptionalReference<E>
- Author:
- Silvan Wyss
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes the elements of the currentClearable.static <T extends IEntity>
OptionalReference<T> forEntityTypes(IContainer<Class<? extends T>> entityTypes) static <T extends IEntity>
OptionalReference<T> forEntityTypes(Class<? extends T>... entityTypes) static <T extends IEntity>
OptionalReference<T> forReferenceableTableNames(IContainer<String> referenceableTableNames) static <T extends IEntity>
OptionalReference<T> forReferenceableTableNames(String... referenceableTableNames) getType()voidinternalSetNullableValue(Object nullableValue, String nullableAdditionalValue) booleanisEmpty()booleanbooleanreferencesEntity(IEntity entity) booleanvoidvoidsetEntityById(String id) Methods inherited from class AbstractBaseReference
getReferenceableTableNames, getStoredBackReferencedBaseReferences, referencesBackEntity, referencesBackEntityWithId, referencesBackFieldMethods inherited from class AbstractField
belongsToDatabase, belongsToEntity, belongsToTable, getName, getState, getStoredParentColumn, getStoredParentDatabase, getStoredParentEntity, getStoredParentTable, isClosed, isConnectedWithRealDatabase, isDeleted, isEdited, isLoaded, isNew, knowsParentColumn, setUpdateActionMethods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CloseStateRequestable
isClosed, isOpenMethods inherited from interface CreationRequestable
isNewMethods inherited from interface DatabaseConnectionRequestable
isConnectedWithRealDatabaseMethods inherited from interface DeletionRequestable
isDeletedMethods inherited from interface EditingRequestable
isEditedMethods inherited from interface EmptinessRequestable
containsAnyMethods inherited from interface IBaseReference
getReferenceableTableNamesMethods inherited from interface IDatabaseComponent
belongsToDatabase, getStoredParentDatabaseMethods inherited from interface IEntityComponent
belongsToEntity, getStoredParentEntityMethods inherited from interface IField
getStoredBackReferencedBaseReferences, getStoredParentColumn, knowsParentColumn, referencesBackEntity, referencesBackEntityWithId, referencesBackField, setUpdateActionMethods inherited from interface INameHolder
getName, getNameInQuotes, hasName, hasSameNameAsMethods inherited from interface ITableComponent
belongsToTable, getStoredParentTableMethods inherited from interface LoadingRequestable
isLoadedMethods inherited from interface MandatorynessRequestable
isOptionalMethods inherited from interface StateRequestable
getState
-
Method Details
-
forEntityTypes
@SafeVarargs public static <T extends IEntity> OptionalReference<T> forEntityTypes(Class<? extends T>... entityTypes) -
forEntityTypes
public static <T extends IEntity> OptionalReference<T> forEntityTypes(IContainer<Class<? extends T>> entityTypes) -
forReferenceableTableNames
public static <T extends IEntity> OptionalReference<T> forReferenceableTableNames(IContainer<String> referenceableTableNames) -
forReferenceableTableNames
public static <T extends IEntity> OptionalReference<T> forReferenceableTableNames(String... referenceableTableNames) -
clear
-
getReferencedEntityId
- Specified by:
getReferencedEntityIdin interfaceIOptionalReference<E extends IEntity>
-
getReferencedTableId
- Specified by:
getReferencedTableIdin interfaceIOptionalReference<E extends IEntity>
-
getReferencedTableName
- Specified by:
getReferencedTableNamein interfaceIOptionalReference<E extends IEntity>
-
getStoredBaseBackReferencesWhoReferencesBackThis
- Specified by:
getStoredBaseBackReferencesWhoReferencesBackThisin interfaceIField
-
getStoredReferencedEntity
- Specified by:
getStoredReferencedEntityin interfaceIOptionalReference<E extends IEntity>
-
getStoredReferencedTable
- Specified by:
getStoredReferencedTablein interfaceIOptionalReference<E extends IEntity>
-
getType
-
internalSetNullableValue
- Specified by:
internalSetNullableValuein interfaceIField
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceEmptinessRequestable- Returns:
- true if
EmptinessRequestabledoes not contain an element, false otherwise.
-
isMandatory
public boolean isMandatory()- Specified by:
isMandatoryin interfaceMandatorynessRequestable- Returns:
- true if the current
MandatorynessRequestableis mandatory, false otherwise.
-
referencesEntity
- Specified by:
referencesEntityin interfaceIField
-
referencesUninsertedEntity
public boolean referencesUninsertedEntity()- Specified by:
referencesUninsertedEntityin interfaceIField
-
setEntity
- Specified by:
setEntityin interfaceIOptionalReference<E extends IEntity>
-
setEntityById
- Specified by:
setEntityByIdin interfaceIOptionalReference<E extends IEntity>
-