Package io.ebean.plugin
Interface BeanType<T>
-
public interface BeanType<T>
Information and methods on BeanDescriptors made available to plugins.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addInheritanceWhere(Query<?> query)
Add the discriminator value to the query if needed.Collection<? extends Property>
allProperties()
Return all the properties for this bean type.Object
beanId(Object bean)
Return the bean id.void
clearBeanCache()
Clear the bean cache.void
clearQueryCache()
Clear the query cache.T
createBean()
Create a new instance of the bean.T
createBeanUsingDisc(Object discValue)
Create a bean given the discriminator value.BeanDocType<T>
docStore()
Return the doc store support for this bean type.\String
getBaseTable()
Return the base table this bean type maps to.Object
getBeanId(T bean)
Return the id value for the given bean.Class<T>
getBeanType()
Return the class type this BeanDescriptor describes.BeanType<?>
getBeanTypeAtPath(String propertyName)
Return the type bean for an OneToMany or ManyToOne or ManyToMany property.String
getDiscColumn()
Return the discriminator column.DocMapping
getDocMapping()
Return the DocumentMapping for this bean type.String
getDocStoreQueueId()
Return the doc store queueId for this bean type.ExpressionPath
getExpressionPath(String path)
Return the ExpressionPath for a given property path.BeanFindController
getFindController()
Return the beanFinder.String
getFullName()
Return the full name of the bean type.Property
getIdProperty()
Return the Id property.IdType
getIdType()
Return the identity generation type.List<BeanType<?>>
getInheritanceChildren()
Returns all direct children of this beantypeBeanType<?>
getInheritanceParent()
Returns the parent in inheritance hiearchyString
getName()
Return the short name of the bean type.BeanPersistController
getPersistController()
Return the bean persist controller.BeanPersistListener
getPersistListener()
Return the bean persist listener.Property
getProperty(String propertyName)
Return the Property to read values from a bean.BeanQueryAdapter
getQueryAdapter()
Return the BeanQueryAdapter or null if none is defined.Property
getWhenCreatedProperty()
Return the when created property if there is one defined.Property
getWhenModifiedProperty()
Return the when modified property if there is one defined.boolean
hasInheritance()
Return true if this bean type has an inheritance hierarchy.boolean
isBeanCaching()
Return true if bean caching is on for this bean type.boolean
isDocStoreMapped()
Return true if this bean type has doc store backing.boolean
isDocStoreOnly()
Return true if the type is document store only.boolean
isInheritanceRoot()
Return true if this object is the root level object in its entity inheritance.boolean
isQueryCaching()
Return true if query caching is on for this bean type.boolean
isValidExpression(String property)
Return true if the property is a valid known property or path for the given bean type.BeanType<?>
root()
Return the root bean type for an inheritance hierarchy.void
setBeanId(T bean, Object idValue)
Set the id value to the bean.void
visitAllInheritanceChildren(Consumer<BeanType<?>> visitor)
Visit all children recursively
-
-
-
Method Detail
-
getFullName
@Nonnull String getFullName()
Return the full name of the bean type.
-
getBeanType
@Nonnull Class<T> getBeanType()
Return the class type this BeanDescriptor describes.
-
getBeanTypeAtPath
BeanType<?> getBeanTypeAtPath(String propertyName)
Return the type bean for an OneToMany or ManyToOne or ManyToMany property.
-
allProperties
@Nonnull Collection<? extends Property> allProperties()
Return all the properties for this bean type.
-
getIdProperty
Property getIdProperty()
Return the Id property.
-
getWhenModifiedProperty
Property getWhenModifiedProperty()
Return the when modified property if there is one defined.
-
getWhenCreatedProperty
Property getWhenCreatedProperty()
Return the when created property if there is one defined.
-
getProperty
Property getProperty(String propertyName)
Return the Property to read values from a bean.
-
getExpressionPath
ExpressionPath getExpressionPath(String path)
Return the ExpressionPath for a given property path.This can return a property or nested property path.
-
isValidExpression
boolean isValidExpression(String property)
Return true if the property is a valid known property or path for the given bean type.
-
isBeanCaching
boolean isBeanCaching()
Return true if bean caching is on for this bean type.
-
isQueryCaching
boolean isQueryCaching()
Return true if query caching is on for this bean type.
-
clearBeanCache
void clearBeanCache()
Clear the bean cache.
-
clearQueryCache
void clearQueryCache()
Clear the query cache.
-
isDocStoreOnly
boolean isDocStoreOnly()
Return true if the type is document store only.
-
getBaseTable
String getBaseTable()
Return the base table this bean type maps to.
-
createBean
T createBean()
Create a new instance of the bean.
-
beanId
Object beanId(Object bean)
Return the bean id. This is the same as getBeanId() but without the generic type.
-
getPersistController
BeanPersistController getPersistController()
Return the bean persist controller.
-
getPersistListener
BeanPersistListener getPersistListener()
Return the bean persist listener.
-
getFindController
BeanFindController getFindController()
Return the beanFinder. Usually null unless overriding the finder.
-
getQueryAdapter
BeanQueryAdapter getQueryAdapter()
Return the BeanQueryAdapter or null if none is defined.
-
isDocStoreMapped
boolean isDocStoreMapped()
Return true if this bean type has doc store backing.
-
getDocMapping
DocMapping getDocMapping()
Return the DocumentMapping for this bean type.This is the document structure and mapping options for how this bean type is mapped for the document store.
-
getDocStoreQueueId
String getDocStoreQueueId()
Return the doc store queueId for this bean type.
-
docStore
BeanDocType<T> docStore()
Return the doc store support for this bean type.\
-
addInheritanceWhere
void addInheritanceWhere(Query<?> query)
Add the discriminator value to the query if needed.
-
hasInheritance
boolean hasInheritance()
Return true if this bean type has an inheritance hierarchy.
-
isInheritanceRoot
boolean isInheritanceRoot()
Return true if this object is the root level object in its entity inheritance.
-
getInheritanceChildren
List<BeanType<?>> getInheritanceChildren()
Returns all direct children of this beantype
-
getInheritanceParent
BeanType<?> getInheritanceParent()
Returns the parent in inheritance hiearchy
-
visitAllInheritanceChildren
void visitAllInheritanceChildren(Consumer<BeanType<?>> visitor)
Visit all children recursively
-
getDiscColumn
String getDiscColumn()
Return the discriminator column.
-
createBeanUsingDisc
T createBeanUsingDisc(Object discValue)
Create a bean given the discriminator value.
-
-