Interface Schema
- All Superinterfaces:
Comparable<StoreElement>,HistoryProvider,IDProvider,PackagePoolItem,StoreElement,TemplateStoreElement,Workflowable
Definition of a database schema description.
- Since:
- 3.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.espirit.firstspirit.storage.HistoryProvider
HistoryProvider.RevisionProviderNested classes/interfaces inherited from interface de.espirit.firstspirit.access.store.IDProvider
IDProvider.DependentReleaseType, IDProvider.RevertType, IDProvider.UidType -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IDProvider.UidTypeUid type, seeIDProvider.getUid().Fields inherited from interface de.espirit.firstspirit.storage.HistoryProvider
ALL_REVISIONS, EVER_SINCE, UNTIL_NOWFields inherited from interface de.espirit.firstspirit.access.store.IDProvider
CHANGED, NEVER_RELEASED, RELEASEDFields inherited from interface de.espirit.firstspirit.access.store.PackagePoolItem
BLOCKED, MODIFIED, UNMODIFIED -
Method Summary
Modifier and TypeMethodDescriptionCreates and adds a query based on this schema's definition to the store.addTableTemplate(EntityType table, String uidSuggestion) Creates and adds a table template based on this schema's definition to the store.createQuery(String uidSuggestion, boolean unifyUidOnServer) Creates a new query under this schema with the given uidSuggestioni.createTableTemplate(EntityType entityType, String uidSuggestion, boolean unifyUidOnServer) Creates a table template under this schema for the given entity type.@NotNull ReferenceEntry[]getIncomingReferences(Entity entity) Returns current incoming references of the givenentity.@NotNull ReferenceEntry[]getIncomingReferences(Entity entity, boolean release) Returns current or release incoming references of the givenentity.getLayer()Provides the layer name for this schema.Provides the type of the layout used for arranging the schema's entries.The database schema.@NotNull ReferenceEntry[]getOutgoingReferences(Entity entity) Returns current outgoing references of the givenentity.@NotNull ReferenceEntry[]getOutgoingReferences(Entity entity, boolean release) Returns current or release outgoing references of the givenentity.@NotNull SessionReturns the currentor sessionSame asgetSession(false).@NotNull SessiongetSession(boolean release) Returns theor session.booleanIndicates the schema to be in read only mode.booleanIndicates the schema to be syncable.voidResest the read timestamp of thesessionsso that external changes in the database become visible.voidSet the database layer to use for this schema.voidDefines the type of the layout used for arranging the schema's entries.voidsetOrSchema(Schema orSchema) Set the database schema.Methods inherited from interface java.lang.Comparable
compareToMethods inherited from interface de.espirit.firstspirit.storage.HistoryProvider
asRevisionProvider, getHistory, getHistoryMethods inherited from interface de.espirit.firstspirit.access.store.IDProvider
contrastWith, getDisplayName, getId, getInRevision, getLanguageInfo, getLongID, getMeta, getMetaFormData, getParent, getReleasedBy, getReleaseRevision, getReleaseRevision, getReleaseStatus, getReleaseStatus, getRevision, getUid, getUidType, hasMeta, hasUid, isInReleaseStore, isInReleaseStore, isReachableInReleaseStore, isReleased, isReleased, isReleaseSupported, moveChild, moveChild, release, release, release, release, revert, setDisplayName, setMeta, setMetaFormData, setUidMethods inherited from interface de.espirit.firstspirit.access.store.PackagePoolItem
addToPackage, getChangeState, getPackage, getPackageName, isAddable, isChangeable, isPackageItem, isSubscribedItem, removeFromPackage, setChangeStateMethods inherited from interface de.espirit.firstspirit.access.store.StoreElement
appendChild, appendChildBefore, delete, exportStoreElement, getChildCount, getChildIndex, getChildren, getChildren, getChildren, getChildren, getCreateWorkflowPermission, getDefinedPrincipalPermissions, getEditor, getElementType, getFirstChild, getIncomingReferences, getInheritedPrincipalPermissions, getLastChanged, getName, getNextSibling, getOutgoingReferences, getPermission, getPermission, getPermission, getPreviousSibling, getProject, getReferenceName, getReferences, getReferences, getStore, getTreePermission, getWorkflowPermission, getWorkflowPermissions, getWriteLock, hasIncomingReferences, hasPermissions, importStoreElement, importStoreElements, inheritWorkflowPermission, isDeleted, isExportSupported, isFolder, isImportSupported, isLocked, isLockedOnServer, isLockSupported, isPermissionSupported, isWorkflowAllowed, isWorkflowSupported, refresh, removeAllWorkflowPermissions, removeChild, removePermission, removePermission, removePermission, removeWorkflowPermission, replaceChild, save, save, save, setInheritWorkflowPermission, setLock, setLock, setPermission, setPermission, setPermission, setWorkflowPermission, setWorkflowPermissions, setWriteLock, toXml, toXml, toXmlMethods inherited from interface de.espirit.firstspirit.access.store.templatestore.TemplateStoreElement
getSubRootInStoreMethods inherited from interface de.espirit.firstspirit.access.Workflowable
getColor, getTask, hasTask, removeTask, setColor, setTask
-
Field Details
-
UID_TYPE
Uid type, seeIDProvider.getUid().- Since:
- 4.0.38
-
-
Method Details
-
getSession
Returns the currentor sessionSame asgetSession(false).- Since:
- 3.0
-
getSession
Returns theor session. Usetrueto get the releaseor session,falseto get the currentor session.- Since:
- 4.0
-
getOrSchema
Schema getOrSchema()The database schema.- Returns:
- The database schema.
- Since:
- 4.0.52
-
setOrSchema
Set the database schema.- Parameters:
orSchema- The database schema to set.- Since:
- 4.0.52
-
getLayer
String getLayer()Provides the layer name for this schema.- Returns:
- The layer name.
- Since:
- 4.0.24
-
setLayer
Set the database layer to use for this schema. Simplified usage example:
String newLayer = ...; String dbSchemaName = ...; schema.
Ensure the layer specified by given layerNamesetLock(true, false); schema.setLayer(newLayer); schema.StoreElement.save(); // sync layer information de.espirit.or.schema.Schema orSchema = schema.getOrSchema(); orSchema.setName(dbSchemaName); schema.setOrSchema(orSchema); schema.StoreElement.save(); // sync database information schema.setLock(false, false);existsin the belonging project.- Parameters:
layerName- The layer name- Since:
- 5.0.313
- See Also:
-
getLayout
Provides the type of the layout used for arranging the schema's entries.- Returns:
- The layout type.
- Throws:
IOException- Since:
- 3.0
-
setLayout
Defines the type of the layout used for arranging the schema's entries.- Parameters:
value- The layout type.- Throws:
IOException- Since:
- 3.0
-
addTableTemplate
TableTemplate addTableTemplate(EntityType table, String uidSuggestion) throws LockException, ElementDeletedException Creates and adds a table template based on this schema's definition to the store.- Parameters:
table- The table type.uidSuggestion- The suggested UID.- Returns:
- The created Template.
- Throws:
LockException- if a required lock could not be acquired.ElementDeletedException- if the schema no longer exists.- Since:
- 3.0
-
createTableTemplate
TableTemplate createTableTemplate(EntityType entityType, String uidSuggestion, boolean unifyUidOnServer) throws LockException, ElementDeletedException Creates a table template under this schema for the given entity type. UseunifyUidOnServer == trueto unify uid on the server. Otherwise aDuplicateReferenceNameExceptionwill be thrown if a table template with the given uid already exists on the server.- Parameters:
entityType- the entity type to create the table template for (seegetOrSchema().getEntityType(String)).uidSuggestion- the suggestion for the uid for the created table templateunifyUidOnServer- indicates wether the given uid should be unified on the server or not- Returns:
- the new table template
- Throws:
LockException- if this schema is locked on the server in a different sessionDuplicateReferenceNameException- if a table template with the given uid already exists for this schema and paramunifyUidOnServer == falseElementDeletedException- if this schema is already deleted on the server.- Since:
- 4.0
- See Also:
-
addQuery
Creates and adds a query based on this schema's definition to the store.- Parameters:
uid- The desired UID.- Returns:
- The created query.
- Throws:
IOException- if accessing the schema failed.LockException- if a required lock could not be acquired.ElementDeletedException- if the schema no longer exists.- Since:
- 3.0
-
createQuery
Query createQuery(String uidSuggestion, boolean unifyUidOnServer) throws LockException, ElementDeletedException Creates a new query under this schema with the given uidSuggestioni. UseunifyUidOnServer == trueto unify uid on the server. Otherwise aDuplicateReferenceNameExceptionwill be thrown if a query or table template with the given uid already exists on the server.- Parameters:
uidSuggestion- the suggestion for the uid for the created table templateunifyUidOnServer- indicates wether the given uid should be unified on the server or not- Returns:
- the new query
- Throws:
LockException- if this schema is locked on the server in a different sessionDuplicateReferenceNameException- if a query with the given uid already exists for this schema and paramunifyUidOnServer == falseElementDeletedException- Since:
- 4.0
-
isReadOnly
boolean isReadOnly()Indicates the schema to be in read only mode.- Returns:
true, if read only.- Since:
- 3.0
-
isSyncable
boolean isSyncable()Indicates the schema to be syncable.- Returns:
true, if syncable.- Since:
- 3.0.110
-
getIncomingReferences
Returns current incoming references of the givenentity.- Parameters:
entity- data object- Returns:
- current incoming references.
- Since:
- 4.0
-
getIncomingReferences
Returns current or release incoming references of the givenentity.- Parameters:
entity- data objectrelease- current or release references.- Returns:
- current incoming references.
- Since:
- 4.0.120
-
getOutgoingReferences
Returns current outgoing references of the givenentity.- Parameters:
entity- data object- Returns:
- current outgoing references.
- Since:
- 4.0
-
getOutgoingReferences
Returns current or release outgoing references of the givenentity.- Parameters:
entity- data objectrelease- current or release references.- Returns:
- current outgoing references.
- Since:
- 4.0.120
-
resetReadTimestamp
void resetReadTimestamp()Resest the read timestamp of thesessionsso that external changes in the database become visible.- Since:
- 4.2.401
-