Class BeanDescriptor<T>

java.lang.Object
io.ebeaninternal.server.deploy.BeanDescriptor<T>
All Implemented Interfaces:
BeanType<T>, SpiBeanType, STreeType

public class BeanDescriptor<T> extends Object implements BeanType<T>, STreeType, SpiBeanType
Describes Beans including their deployment information.
  • Constructor Details

  • Method Details

    • idSelect

      public String idSelect()
    • isJacksonCorePresent

      public boolean isJacksonCorePresent()
    • config

      public DatabaseBuilder.Settings config()
      Return the DatabaseConfig.
    • setEbeanServer

      public void setEbeanServer(SpiEbeanServer ebeanServer)
      Set the server. Primarily so that the Many's can lazy load.
    • ebeanServer

      public SpiEbeanServer ebeanServer()
      Return the EbeanServer instance that owns this BeanDescriptor.
    • isDocStoreOnly

      public boolean isDocStoreOnly()
      Return true if this is a "Doc Store only" entity bean.
      Specified by:
      isDocStoreOnly in interface BeanType<T>
    • entityType

      public BeanDescriptor.EntityType entityType()
      Return the type of this domain object.
    • propertyByIndex

      public BeanProperty propertyByIndex(int pos)
    • initialiseOther

      public void initialiseOther(io.ebeaninternal.server.deploy.BeanDescriptorInitContext initContext)
      Initialise the exported and imported parts for associated properties.
    • isBatchEscalateOnCascade

      public boolean isBatchEscalateOnCascade(PersistRequest.Type type)
      Return false if JDBC batch can't be implicitly escalated to. This happens when we have circular import id situation (need to defer setting identity value).
    • metricPersistBatch

      public void metricPersistBatch(PersistRequest.Type type, long startNanos, int size)
    • metricPersistNoBatch

      public void metricPersistNoBatch(PersistRequest.Type type, long startNanos)
    • merge

      public void merge(EntityBean bean, EntityBean existing)
    • bindElementValue

      public void bindElementValue(SqlUpdate insert, Object value)
      Bind all the property values to the SqlUpdate.
    • isChangeLog

      public boolean isChangeLog()
    • changeLogBean

      public BeanChange changeLogBean(PersistRequestBean<T> request)
      Return true if this request should be included in the change log.
    • deleteById

      public SqlUpdate deleteById(Object id, List<Object> idList, DeleteMode mode)
    • whereIdInSql

      public String whereIdInSql()
      Return the "where id in" sql (for use with UpdateQuery).
    • deleteByIdInSql

      public String deleteByIdInSql()
      Return the "delete by id" sql.
    • add

      public void add(BeanFkeyProperty fkey)
      Add objects to ElPropertyDeploy etc. These are used so that expressions on foreign keys don't require an extra join.
    • cacheOptions

      public CacheOptions cacheOptions()
      Return the cache options.
    • encryptKey

      public EncryptKey encryptKey(BeanProperty p)
      Return the Encrypt key given the BeanProperty.
    • encryptKey

      public EncryptKey encryptKey(String tableName, String columnName)
      Return the Encrypt key given the table and column name.
    • scalarType

      public ScalarType<?> scalarType(int jdbcType)
      Return the Scalar type for the given JDBC type.
    • scalarType

      public ScalarType<?> scalarType(String cast)
    • hasDefaultSelectClause

      public boolean hasDefaultSelectClause()
      Return true if this bean type has a default select clause that is not simply select all properties.
    • defaultSelectClause

      public String defaultSelectClause()
      Return the default select clause.
    • prepareQuery

      public void prepareQuery(SpiQuery<T> query)
      Prepare the query for multi-tenancy check for document store only use.
    • naturalKey

      public BeanNaturalKey naturalKey()
      Return the natural key.
    • isBeanCaching

      public boolean isBeanCaching()
      Return true if there is currently bean caching for this type of bean.
      Specified by:
      isBeanCaching in interface BeanType<T>
    • isNaturalKeyCaching

      public boolean isNaturalKeyCaching()
      Return true if there is a natural key defined for this bean type.
    • isQueryCaching

      public boolean isQueryCaching()
      Return true if there is query caching for this type of bean.
      Specified by:
      isQueryCaching in interface BeanType<T>
    • isManyPropCaching

      public boolean isManyPropCaching()
    • isCacheNotify

      public boolean isCacheNotify(PersistRequest.Type type)
      Return true if the persist request needs to notify the cache.
    • clearBeanCache

      public void clearBeanCache()
      Specified by:
      clearBeanCache in interface BeanType<T>
    • clearQueryCache

      public void clearQueryCache()
      Clear the query cache.
      Specified by:
      clearQueryCache in interface BeanType<T>
    • queryCacheGet

      public Object queryCacheGet(Object id)
      Get a query result from the query cache.
    • queryCachePut

      public void queryCachePut(Object id, QueryCacheEntry entry)
      Put a query result into the query cache.
    • cacheManyPropLoad

      public boolean cacheManyPropLoad(BeanPropertyAssocMany<?> many, BeanCollection<?> bc, String parentKey, Boolean readOnly)
      Try to load the beanCollection from cache return true if successful.
    • cacheManyPropPut

      public void cacheManyPropPut(BeanPropertyAssocMany<?> many, BeanCollection<?> bc, String parentKey)
      Put the beanCollection into the cache.
    • cacheManyPropPut

      public void cacheManyPropPut(String name, String parentKey, CachedManyIds entry)
      Update the bean collection entry in the cache.
    • cacheManyPropRemove

      public void cacheManyPropRemove(String propertyName, String parentKey)
    • cacheManyPropClear

      public void cacheManyPropClear(String propertyName)
    • cacheEmbeddedBeanExtract

      public CachedBeanData cacheEmbeddedBeanExtract(EntityBean bean)
      Extract the raw cache data from the embedded bean.
    • cacheEmbeddedBeanLoad

      public EntityBean cacheEmbeddedBeanLoad(CachedBeanData data, PersistenceContext context)
      Load the embedded bean (taking into account inheritance).
    • cacheBeanPut

      public void cacheBeanPut(T bean)
      Put the bean into the cache.
    • cacheBeanPut

      public void cacheBeanPut(EntityBean bean)
      Put a bean into the bean cache (taking into account inheritance).
    • cacheBeanPutAll

      public void cacheBeanPutAll(Collection<?> beans)
    • cacheBeanGet

      public T cacheBeanGet(Object id, Boolean readOnly, PersistenceContext context)
      Return a bean from the bean cache (or null).
    • cacheApplyInvalidate

      public void cacheApplyInvalidate(Collection<Object> ids)
      Remove a collection of beans from the cache given the ids.
    • cacheBeanLoadAll

      public Set<EntityBeanIntercept> cacheBeanLoadAll(Set<EntityBeanIntercept> batch, PersistenceContext persistenceContext, int lazyLoadProperty, String propertyName)
      Hit the bean cache trying to load a list/batch of entities. Return the set of entities that were successfully loaded from L2 cache.
    • cacheBeanLoad

      public boolean cacheBeanLoad(EntityBean bean, EntityBeanIntercept ebi, Object id, PersistenceContext context)
      Returns true if it managed to populate/load the bean from the cache.
    • cacheIdLookup

      public BeanCacheResult<T> cacheIdLookup(PersistenceContext context, Collection<?> ids)
    • naturalKeyLookup

      public BeanCacheResult<T> naturalKeyLookup(PersistenceContext context, Set<Object> keys)
      Use natural key lookup to hit the bean cache.
    • cacheNaturalKeyPut

      public void cacheNaturalKeyPut(String key, String newKey)
    • cacheUpdateQuery

      public void cacheUpdateQuery(boolean update, SpiTransaction transaction)
      Check if bulk update or delete query has a cache impact.
    • cachePersistDeleteByIds

      public void cachePersistDeleteByIds(Collection<Object> ids, CacheChangeSet changeSet)
      Remove a bean from the cache given its Id.
    • cachePersistDelete

      public void cachePersistDelete(Object id, PersistRequestBean<T> deleteRequest, CacheChangeSet changeSet)
      Remove a bean from the cache given its Id.
    • cachePersistInsert

      public void cachePersistInsert(PersistRequestBean<T> insertRequest, CacheChangeSet changeSet)
      Add the insert changes to the changeSet.
    • cachePersistUpdate

      public void cachePersistUpdate(Object id, PersistRequestBean<T> updateRequest, CacheChangeSet changeSet)
      Add the update to the changeSet.
    • cacheApplyBeanUpdate

      public void cacheApplyBeanUpdate(String key, Map<String,Object> changes, boolean updateNaturalKey, long version)
      Apply the update to the cache.
    • baseTableAlias

      public String baseTableAlias()
      Return the base table alias. This is always the first letter of the bean name.
    • preAllocateIds

      public void preAllocateIds(int batchSize)
    • nextId

      public Object nextId(Transaction t)
    • parser

      public DeployPropertyParser parser()
    • convertOrmUpdateToSql

      public String convertOrmUpdateToSql(String ormUpdateStatement)
      Convert the logical orm update statement into sql by converting the bean properties and bean name to database columns and table.
    • visitMetrics

      public void visitMetrics(MetricVisitor visitor)
      Visit all the ORM query plan metrics (includes UpdateQuery with updates and deletes).
    • clearQueryStatistics

      public void clearQueryStatistics()
      Reset the statistics on all the query plans.
    • postLoad

      public void postLoad(Object bean)
      Execute the postLoad if a BeanPostLoad exists for this bean.
      Specified by:
      postLoad in interface STreeType
    • queryPlan

      public CQueryPlan queryPlan(CQueryPlanKey key)
    • queryPlan

      public void queryPlan(CQueryPlanKey key, CQueryPlan plan)
    • updatePlan

      public SpiUpdatePlan updatePlan(String key)
      Get a UpdatePlan for a given hash.
    • updatePlan

      public void updatePlan(String key, SpiUpdatePlan plan)
      Add a UpdatePlan to the cache with a given hash.
    • updateImportedIdSql

      public String updateImportedIdSql(ImportedId prop)
      Return a Sql update statement to set the importedId value (deferred execution).
    • isDeleteByStatement

      public boolean isDeleteByStatement()
      Return true if delete can use a single SQL statement.

      This implies cascade delete does not continue depth wise and that this is no associated L2 bean caching.

    • isDeleteByBulk

      public boolean isDeleteByBulk()
    • whenModifiedProperty

      public BeanProperty whenModifiedProperty()
      Return the 'when modified' property if there is one defined.
      Specified by:
      whenModifiedProperty in interface BeanType<T>
    • whenCreatedProperty

      public BeanProperty whenCreatedProperty()
      Return the 'when created' property if there is one defined.
      Specified by:
      whenCreatedProperty in interface BeanType<T>
    • manyProperty

      public BeanPropertyAssocMany<?> manyProperty(SpiQuery<?> query)
      Return the many property included in the query or null if one is not.
    • idBinder

      public IdBinder idBinder()
      Return the IdBinder which is helpful for handling the various types of Id.
      Specified by:
      idBinder in interface STreeType
    • hasId

      public boolean hasId()
      Description copied from interface: STreeType
      Return true if the underlying type has an Id property.
      Specified by:
      hasId in interface STreeType
    • hasSingleIdProperty

      public boolean hasSingleIdProperty()
      Return false for IdClass case with multiple @Id properties.
    • isMultiValueIdSupported

      public boolean isMultiValueIdSupported()
      Return true if this type has a simple Id and the platform supports mutli-value binding.
    • isPadInExpression

      public boolean isPadInExpression()
      Return true if Id IN expression should have bind parameters padded.
    • idBinderIdSql

      public String idBinderIdSql(String alias)
      Return the sql for binding an id. This is the columns with table alias that make up the id.
    • idBinderInLHSSql

      public String idBinderInLHSSql()
      Return the sql for binding id's using an IN clause.
    • bindId

      public void bindId(io.ebeaninternal.server.bind.DataBind dataBind, Object idValue) throws SQLException
      Bind the idValue to the preparedStatement.

      This takes care of the various id types such as embedded beans etc.

      Throws:
      SQLException
    • bindIdValues

      public Object[] bindIdValues(Object idValue)
      Return the id as an array of scalar bindable values.

      This 'flattens' any EmbeddedId or multiple Id property cases.

    • createBean

      public T createBean()
      Specified by:
      createBean in interface BeanType<T>
    • createEntityBean

      public EntityBean createEntityBean()
      Creates a new entity bean without invoking BeanPostConstructListener.postCreate(Object)
      Specified by:
      createEntityBean in interface STreeType
    • createEntityBean2

      public EntityBean createEntityBean2(boolean readOnlyNoIntercept)
      Description copied from interface: STreeType
      Create a new entity bean instance with option for read only optimisation.
      Specified by:
      createEntityBean2 in interface STreeType
    • createEntityBeanForJson

      public EntityBean createEntityBeanForJson()
      Create an entity bean for JSON marshalling (which differs for the element collection case).
    • createReference

      public EntityBean createReference(Boolean readOnly, Object id, PersistenceContext pc)
      Create a reference with a check for the bean in the persistence context.
    • createReference

      public T createReference(Boolean readOnly, boolean disableLazyLoad, Object id, PersistenceContext pc)
      Create a reference bean based on the id.
    • createReference

      public T createReference(Object id, PersistenceContext pc)
      Create a non read only reference bean without checking cacheSharableBeans.
    • createRef

      public T createRef(Object id, PersistenceContext pc)
    • findPropertyFromPath

      public BeanProperty findPropertyFromPath(String path)
      Return the bean property traversing the object graph and taking into account inheritance.
      Specified by:
      findPropertyFromPath in interface STreeType
    • beanTypeAtPath

      public BeanType<?> beanTypeAtPath(String path)
      Specified by:
      beanTypeAtPath in interface BeanType<T>
    • descriptor

      public BeanDescriptor<?> descriptor(String path)
      Return the BeanDescriptor for a given path of Associated One or Many beans.
    • descriptor

      public <U> BeanDescriptor<U> descriptor(Class<U> otherType)
      Return the BeanDescriptor of another bean type.
    • isTableManaged

      public boolean isTableManaged(String tableName)
      Returns true, if the table is managed (i.e. an existing m2m relation).
    • orderColumn

      public BeanProperty orderColumn()
      Return the order column property.
    • unidirectional

      public BeanPropertyAssocOne<?> unidirectional()
      Return the "shadow" property to support unidirectional relationships.

      For bidirectional this is a real property on the bean. For unidirectional relationships we have this 'shadow' property which is not externally visible.

    • isUseIdGenerator

      public boolean isUseIdGenerator()
      Return true if this bean type should use IdGeneration.

      If this is false and the Id is null it is assumed that a database auto increment feature is being used to populate the id.

    • descriptorId

      public String descriptorId()
      Return bean class name.
    • type

      public Class<T> type()
      Return the class type this BeanDescriptor describes.
      Specified by:
      type in interface BeanType<T>
    • fullName

      public String fullName()
      Return the bean class name this descriptor is used for.

      If this BeanDescriptor is for a table then this returns the table name instead.

      Specified by:
      fullName in interface BeanType<T>
    • name

      public String name()
      Return the short name of the entity bean.
      Specified by:
      name in interface BeanType<T>
      Specified by:
      name in interface STreeType
    • simpleName

      public String simpleName()
      Return the simple name of the entity bean.
    • toString

      public String toString()
      Summary description.
      Overrides:
      toString in class Object
    • contextGet

      public Object contextGet(PersistenceContext pc, Object id)
      Get the bean from the persistence context.
    • contextGetWithOption

      public PersistenceContext.WithOption contextGetWithOption(PersistenceContext pc, Object id)
      Get the bean from the persistence context with delete check option.
    • contextPut

      public void contextPut(PersistenceContext pc, Object id, Object bean)
      Put the bean into the persistence context.
    • contextPutIfAbsent

      public Object contextPutIfAbsent(PersistenceContext pc, Object id, EntityBean localBean)
      Put the bean into the persistence context if it is absent.
      Specified by:
      contextPutIfAbsent in interface STreeType
    • contextRef

      public Object contextRef(PersistenceContext pc, Boolean readOnly, boolean disableLazyLoad, Object id)
      Create a reference bean and put it in the persistence context (and return it).
    • contextClear

      public void contextClear(PersistenceContext pc, Object idValue)
      Clear a bean from the persistence context.
    • contextClear

      public void contextClear(PersistenceContext pc)
      Clear a bean from the persistence context.
    • contextDeleted

      public void contextDeleted(PersistenceContext pc, Object idValue)
      Delete a bean from the persistence context (such that we don't fetch it in the same transaction).
    • idName

      public String idName()
      Return the Id property name or null if no Id property exists.
    • getId

      public Object getId(EntityBean bean)
      Helper method to return the unique property. If only one property makes up the unique id then it's value is returned. If there is a concatenated unique id then a Map is built with the keys being the names of the properties that make up the unique id.
    • cacheKeyForBean

      public String cacheKeyForBean(EntityBean bean)
      Return the cache key for the given bean (based on id value).
    • cacheKey

      public String cacheKey(Object id)
      Return the cache key for the given id value.
    • id

      public Object id(Object bean)
      Specified by:
      id in interface BeanType<T>
    • idForJson

      public Object idForJson(Object bean)
      Return the Id value for the bean with embeddedId beans converted into maps.

      The usage is to provide simple id types for JSON processing (for embeddedId's).

    • defaultOrderBy

      public String defaultOrderBy()
      Return the default order by that may need to be added if a many property is included in the query.
    • convertId

      public Object convertId(Object idValue)
      Convert the type of the idValue if required.
    • setId

      public void setId(T bean, Object idValue)
      Set the bean id value converting if necessary.
      Specified by:
      setId in interface BeanType<T>
    • convertSetId

      public Object convertSetId(Object idValue, EntityBean bean)
      Convert and set the id value.

      If the bean is not null, the id value is set to the id property of the bean after it has been converted to the correct type.

    • setId

      public void setId(Object idValue, EntityBean bean)
      Set the Id value to the bean (without type conversion).
    • property

      public Property property(String propName)
      Specified by:
      property in interface BeanType<T>
    • beanProperty

      public BeanProperty beanProperty(String propName)
      Get a BeanProperty by its name.
    • sort

      public void sort(List<T> list, String sortByClause)
    • elComparator

      public ElComparator<T> elComparator(String propNameOrSortBy)
    • lazyLoadRegister

      public void lazyLoadRegister(String prefix, EntityBeanIntercept ebi, EntityBean bean, LoadContext loadContext)
      Register all the assoc many properties on this bean that are not populated with the load context.

      This provides further lazy loading via the load context.

    • lazyLoadMany

      public boolean lazyLoadMany(EntityBeanIntercept ebi)
      Return true if the lazy loading property is a Many in which case just define a Reference for the collection and not invoke a query.
    • lazyLoadMany

      public boolean lazyLoadMany(EntityBeanIntercept ebi, LoadBeanContext parent)
    • isGeneratedProperty

      public boolean isGeneratedProperty(int propertyIndex)
      Return true if this is a generated property.
    • isValidExpression

      public boolean isValidExpression(String propertyName)
      Specified by:
      isValidExpression in interface BeanType<T>
    • elGetValue

      public ElPropertyValue elGetValue(String propName)
      Get an Expression language Value object.
    • expressionPath

      public ExpressionPath expressionPath(String path)
      Specified by:
      expressionPath in interface BeanType<T>
    • elPropertyDeploy

      public ElPropertyDeploy elPropertyDeploy(String propName)
      Similar to ElPropertyValue but also uses foreign key shortcuts.

      The foreign key shortcuts means we can avoid unnecessary joins.

    • findBeanPath

      public String findBeanPath(String schemaName, String tableName, String columnName)
      Return the property path given the db table and column.
    • findPropertyWithDynamic

      public STreeProperty findPropertyWithDynamic(String propName, String path)
      Return a property that is part of the SQL tree.

      The property can be a dynamic formula or a well known bean property.

      Specified by:
      findPropertyWithDynamic in interface STreeType
    • findProperty

      public BeanProperty findProperty(String propName)
      Find a BeanProperty including searching the inheritance hierarchy.

      This searches this BeanDescriptor and then searches further down the inheritance tree (not up).

      Specified by:
      findProperty in interface STreeType
    • resetManyProperties

      public void resetManyProperties(Object dbBean)
      Reset the many properties to empty state ready for reloading.
    • isCacheSharableBeans

      public boolean isCacheSharableBeans()
      Return true if this bean can cache sharable instances.

      This means is has no relationships and has readOnly=true in its cache options.

    • isAutoTunable

      public boolean isAutoTunable()
      Return true if queries for beans of this type are auto tunable.
    • isEmbedded

      public boolean isEmbedded()
      Return true if this is an embedded bean.
    • indexDefinitions

      public IndexDefinition[] indexDefinitions()
      Return the compound unique constraints.
    • persistListener

      public BeanPersistListener persistListener()
      Return the beanListener.
      Specified by:
      persistListener in interface BeanType<T>
    • beanFinder

      public BeanFindController beanFinder()
      Return the beanFinder (Migrate over to getFindController).
    • findController

      public BeanFindController findController()
      Return the find controller (SPI interface).
      Specified by:
      findController in interface BeanType<T>
    • queryAdapter

      public BeanQueryAdapter queryAdapter()
      Return the BeanQueryAdapter or null if none is defined.
      Specified by:
      queryAdapter in interface BeanType<T>
    • deregister

      public void deregister(BeanPersistListener listener)
      De-register the BeanPersistListener.
    • deregister

      public void deregister(BeanPersistController controller)
      De-register the BeanPersistController.
    • register

      public void register(BeanPersistListener newPersistListener)
      Register the new BeanPersistController.
    • register

      public void register(BeanPersistController newController)
      Register the new BeanPersistController.
    • persistController

      public BeanPersistController persistController()
      Return the Controller.
      Specified by:
      persistController in interface BeanType<T>
    • isRawSqlBased

      public boolean isRawSqlBased()
      Returns true if this bean is based on RawSql.
      Specified by:
      isRawSqlBased in interface STreeType
    • dbComment

      public String dbComment()
      Return the DB comment for the base table.
    • suppressForeignKey

      public boolean suppressForeignKey()
      Return true if foreign keys to the base table should be suppressed.
    • partitionMeta

      public PartitionMeta partitionMeta()
      Return the partition details of the bean.
    • tablespaceMeta

      public TablespaceMeta tablespaceMeta()
      Return the tablespace details of the bean.
    • storageEngine

      public String storageEngine()
      Return the storage engine.
    • dependentTables

      public String[] dependentTables()
      Return the dependent tables for a view based entity.
    • baseTable

      public String baseTable()
      Return the base table. Only properties mapped to the base table are by default persisted.
      Specified by:
      baseTable in interface BeanType<T>
    • isBaseTable

      public boolean isBaseTable()
      Return true if this type is a base table entity type.
    • baseTable

      public String baseTable(SpiQuery.TemporalMode mode)
      Return the base table to use given the query temporal mode.
      Specified by:
      baseTable in interface STreeType
    • isSoftDelete

      public boolean isSoftDelete()
      Description copied from interface: STreeType
      Return true if the type uses soft delete.
      Specified by:
      isSoftDelete in interface STreeType
    • softDeleteValue

      public void softDeleteValue(EntityBean bean)
    • softDeletePredicate

      public String softDeletePredicate(String tableAlias)
      Description copied from interface: STreeType
      Return the soft delete predicate using the given table alias.
      Specified by:
      softDeletePredicate in interface STreeType
    • markAsDeleted

      public void markAsDeleted(EntityBean bean)
      Description copied from interface: STreeType
      Mark the bean as deleted by setting the softDelete property to true. This works also, if there is only a virtual softDelete property computed by a formula. If there is no soft delete property, it sets the lazyLoadFailure flag in EBI.
      Specified by:
      markAsDeleted in interface STreeType
    • pathMap

      public Map<String,String> pathMap(String prefix)
      Description copied from interface: STreeType
      Return the "path map" to toMany or toOne properties using the given prefix.
      Specified by:
      pathMap in interface STreeType
    • isEmbeddedPath

      public boolean isEmbeddedPath(String propertyPath)
      Description copied from interface: STreeType
      Return true if the given path is an embedded bean.
      Specified by:
      isEmbeddedPath in interface STreeType
    • extraJoin

      public ExtraJoin extraJoin(String propertyPath)
      Description copied from interface: STreeType
      Return an extra join if the property path requires it.
      Specified by:
      extraJoin in interface STreeType
    • inheritanceLoad

      public void inheritanceLoad(SqlBeanLoad sqlBeanLoad, STreeProperty property, DbReadContext ctx)
      Description copied from interface: STreeType
      Load the property taking into account inheritance.
      Specified by:
      inheritanceLoad in interface STreeType
    • setTenantId

      public void setTenantId(EntityBean entityBean, Object tenantId)
      Set the Tenant Id value to the bean.
    • isToManyDirty

      public boolean isToManyDirty(EntityBean bean)
      Description copied from interface: SpiBeanType
      Return true if the bean contains a many property that has modifications.

      That is a ManyToMany or a OneToMany with orphan removal with additions or removals from the collection.

      Specified by:
      isToManyDirty in interface SpiBeanType
    • isHistorySupport

      public boolean isHistorySupport()
      Return true if this entity bean has history support.
      Specified by:
      isHistorySupport in interface STreeType
    • idType

      public IdType idType()
      Return the identity generation type.
      Specified by:
      idType in interface BeanType<T>
    • setGeneratedId

      public void setGeneratedId(EntityBean entityBean, Transaction transaction)
      Set the generated Id value if appropriate.
    • isIdGeneratedValue

      public boolean isIdGeneratedValue()
      Return true if the Id value is marked as a @GeneratedValue.
    • identityMode

      public IdentityMode identityMode()
    • selectLastInsertedId

      public String selectLastInsertedId()
      Return the SQL used to return the last inserted id.

      This is only used with Identity columns and getGeneratedKeys is not supported.

    • supportsSelectLastInsertedId

      public boolean supportsSelectLastInsertedId()
      Return true if this bean uses a SQL select to fetch the last inserted id value.
    • allProperties

      public Collection<? extends Property> allProperties()
      Specified by:
      allProperties in interface BeanType<T>
    • propertiesAll

      public Collection<BeanProperty> propertiesAll()
      Return a collection of all BeanProperty. This includes transient properties.
    • propertyUnmappedJson

      public BeanProperty propertyUnmappedJson()
      Return the property that holds unmapped JSON content.
    • propertiesNonTransient

      public BeanProperty[] propertiesNonTransient()
      Return the non transient non id properties.
    • propertiesTransient

      public BeanProperty[] propertiesTransient()
      Return the transient properties.
    • propertiesEmbedded

      public BeanPropertyAssocOne<?>[] propertiesEmbedded()
      Return the beans that are embedded. These share the base table with the owner bean.
    • includesAggregation

      public boolean includesAggregation(OrmQueryDetail detail)
      Return true if the query detail includes an aggregation property.
    • setAllLoaded

      public void setAllLoaded(EntityBean bean)
      Set all properties to be loaded (recurse to embedded beans).
    • primaryKeyJoin

      public TableJoin primaryKeyJoin()
    • idProperty

      public BeanProperty idProperty()
      Specified by:
      idProperty in interface BeanType<T>
    • isInsertMode

      public boolean isInsertMode(EntityBeanIntercept ebi, boolean insertMode)
      Return true if this bean should be inserted rather than updated.
      Parameters:
      ebi - The entity bean intercept
      insertMode - true if the 'root request' was an insert rather than an update
    • isReference

      public boolean isReference(EntityBeanIntercept ebi)
    • referenceIdPropertyOnly

      public boolean referenceIdPropertyOnly(EntityBeanIntercept ebi)
    • isIdLoaded

      public boolean isIdLoaded(EntityBeanIntercept ebi)
    • setVersion

      public long setVersion(EntityBean entityBean, Object versionValue)
      Set the version value returning it in primitive long form.
    • getVersion

      public long getVersion(EntityBean entityBean)
      Return the version value in primitive long form (if exists and set).
    • checkAllMutableProperties

      public void checkAllMutableProperties(EntityBeanIntercept ebi)
      Check all mutable scalar types and mark as dirty if necessary.
    • checkAnyMutableProperties

      public void checkAnyMutableProperties(EntityBeanIntercept ebi)
      Return true if any mutable properties are dirty.
    • concurrencyMode

      public ConcurrencyMode concurrencyMode(EntityBeanIntercept ebi)
    • diff

      public Map<String,ValuePair> diff(EntityBean newBean, EntityBean oldBean)
      Return the diff comparing the bean values.
    • diff

      public void diff(String prefix, Map<String,ValuePair> map, EntityBean newBean, EntityBean oldBean)
      Populate the diff for updates with flattened non-null property values.
    • appendOrderById

      public void appendOrderById(SpiQuery<T> query)
      Appends the Id property to the OrderBy clause if it is not believed to be already contained in the order by.

      This is primarily used for paging queries to ensure that an order by clause is provided and that the order by provides unique ordering of the rows (so that the paging is predicable).

    • propsBaseScalar

      public STreeProperty[] propsBaseScalar()
      Description copied from interface: STreeType
      Return the scalar properties.
      Specified by:
      propsBaseScalar in interface STreeType
    • propsEmbedded

      public STreePropertyAssoc[] propsEmbedded()
      Description copied from interface: STreeType
      Return the embedded bean properties.
      Specified by:
      propsEmbedded in interface STreeType
    • propsOne

      public STreePropertyAssocOne[] propsOne()
      Description copied from interface: STreeType
      Return the associated one properties.
      Specified by:
      propsOne in interface STreeType
    • propsMany

      public STreePropertyAssocMany[] propsMany()
      Description copied from interface: STreeType
      Return the associated many properties.
      Specified by:
      propsMany in interface STreeType
    • propertiesOne

      public BeanPropertyAssocOne<?>[] propertiesOne()
      All the BeanPropertyAssocOne that are not embedded. These are effectively joined beans. For ManyToOne and OneToOne associations.
    • propertiesOneImported

      public BeanPropertyAssocOne<?>[] propertiesOneImported()
      Returns ManyToOnes and OneToOnes on the imported owning side.

      Excludes OneToOnes on the exported side.

    • propertiesOneImportedSave

      public BeanPropertyAssocOne<?>[] propertiesOneImportedSave()
      Imported Assoc Ones with cascade save true.
    • propertiesOneImportedDelete

      public BeanPropertyAssocOne<?>[] propertiesOneImportedDelete()
      Imported Assoc Ones with cascade delete true.
    • propertiesOneExportedSave

      public BeanPropertyAssocOne<?>[] propertiesOneExportedSave()
      Exported assoc ones with cascade save.
    • propertiesOneExportedDelete

      public BeanPropertyAssocOne<?>[] propertiesOneExportedDelete()
      Exported assoc ones with delete cascade.
    • propertiesNonMany

      public BeanProperty[] propertiesNonMany()
      All Non Assoc Many's for this descriptor.
    • propertiesMany

      public BeanPropertyAssocMany<?>[] propertiesMany()
      All Assoc Many's for this descriptor.
    • propertiesManySave

      public BeanPropertyAssocMany<?>[] propertiesManySave()
      Assoc Many's with save cascade.
    • propertiesManyDelete

      public BeanPropertyAssocMany<?>[] propertiesManyDelete()
      Assoc Many's with delete cascade.
    • propertiesManyToMany

      public BeanPropertyAssocMany<?>[] propertiesManyToMany()
      Assoc ManyToMany's.
    • versionProperty

      public BeanProperty versionProperty()
      Return the first version property that exists on the bean. Returns null if no version property exists on the bean.

      Note that this DOES NOT find a version property on an embedded bean.

    • isMultiTenant

      public boolean isMultiTenant()
      Return true if this type is tenant aware.
    • tenantProperty

      public BeanProperty tenantProperty()
      Return the tenant property when multi-tenant partitioning support is used.
    • propertiesBaseScalar

      public BeanProperty[] propertiesBaseScalar()
      Scalar properties without the unique id or secondary table properties.
    • propertiesGenInsert

      public BeanProperty[] propertiesGenInsert()
      Return the properties set as generated values on insert.
    • propertiesGenUpdate

      public BeanProperty[] propertiesGenUpdate()
      Return the properties set as generated values on update.
    • jsonWriteDirty

      public void jsonWriteDirty(SpiJsonWriter writeJson, EntityBean bean, boolean[] dirtyProps) throws IOException
      Throws:
      IOException
    • jsonWriteMapEntry

      public void jsonWriteMapEntry(SpiJsonWriter ctx, Map.Entry<?,?> entry) throws IOException
      Throws:
      IOException
    • jsonWriteElement

      public void jsonWriteElement(SpiJsonWriter ctx, Object element)
    • jsonReadCollection

      public Object jsonReadCollection(SpiJsonReader readJson, EntityBean parentBean) throws IOException
      Throws:
      IOException
    • isJsonReadCollection

      public boolean isJsonReadCollection()
    • jsonWrite

      public void jsonWrite(SpiJsonWriter writeJson, EntityBean bean) throws IOException
      Throws:
      IOException
    • jsonWrite

      public void jsonWrite(SpiJsonWriter writeJson, EntityBean bean, String key) throws IOException
      Throws:
      IOException
    • jsonRead

      public T jsonRead(SpiJsonReader jsonRead, String path, T target) throws IOException
      Throws:
      IOException
    • uniqueProps

      public List<BeanProperty[]> uniqueProps()