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.RevisionProvider
Nested classes/interfaces inherited from interface de.espirit.firstspirit.access.store.IDProvider
IDProvider.DependentReleaseType, IDProvider.RevertType, IDProvider.UidType
-
Field Summary
Modifier and TypeFieldDescriptionstatic final IDProvider.UidType
Uid type, seeIDProvider.getUid()
.Fields inherited from interface de.espirit.firstspirit.storage.HistoryProvider
ALL_REVISIONS, EVER_SINCE, UNTIL_NOW
Fields inherited from interface de.espirit.firstspirit.access.store.IDProvider
CHANGED, NEVER_RELEASED, RELEASED
Fields 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 Session
Returns the currentor session
Same asgetSession(false)
.@NotNull Session
getSession
(boolean release) Returns theor session
.boolean
Indicates the schema to be in read only mode.boolean
Indicates the schema to be syncable.void
Resest the read timestamp of thesessions
so that external changes in the database become visible.void
Set the database layer to use for this schema.void
Defines the type of the layout used for arranging the schema's entries.void
setOrSchema
(Schema orSchema) Set the database schema.Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface de.espirit.firstspirit.storage.HistoryProvider
asRevisionProvider, getHistory, getHistory
Methods inherited from interface de.espirit.firstspirit.access.store.IDProvider
contrastWith, getDisplayName, getId, getInRevision, getLanguageInfo, getLongID, getMeta, getMetaFormData, getParent, getReleasedBy, getReleaseRevision, getReleaseStatus, getRevision, getUid, getUidType, hasMeta, hasUid, isInReleaseStore, isReleased, isReleaseSupported, moveChild, moveChild, release, release, revert, setDisplayName, setMeta, setMetaFormData, setUid
Methods inherited from interface de.espirit.firstspirit.access.store.PackagePoolItem
addToPackage, getChangeState, getPackage, getPackageName, isAddable, isChangeable, isPackageItem, isSubscribedItem, removeFromPackage, setChangeState
Methods 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, 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, toXml
Methods inherited from interface de.espirit.firstspirit.access.store.templatestore.TemplateStoreElement
getSubRootInStore
Methods 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 session
Same asgetSession(false)
.- Since:
- 3.0
-
getSession
Returns theor session
. Usetrue
to get the releaseor session
,false
to 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)
;exists
in 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 == true
to unify uid on the server. Otherwise aDuplicateReferenceNameException
will 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 == false
ElementDeletedException
- 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 == true
to unify uid on the server. Otherwise aDuplicateReferenceNameException
will 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 == false
ElementDeletedException
- 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 thesessions
so that external changes in the database become visible.- Since:
- 4.2.401
-