001package com.avaje.ebean.plugin;
002
003import com.avaje.ebean.config.dbplatform.IdType;
004import com.avaje.ebean.event.BeanFindController;
005import com.avaje.ebean.event.BeanPersistController;
006import com.avaje.ebean.event.BeanPersistListener;
007import com.avaje.ebean.event.BeanQueryAdapter;
008
009/**
010 * Information and methods on BeanDescriptors made available to plugins.
011 */
012public interface SpiBeanType<T> {
013
014  /**
015   * Return the class type this BeanDescriptor describes.
016   */
017  Class<T> getBeanType();
018
019  /**
020   * Return true if the property is a valid known property or path for the given bean type.
021   */
022  boolean isValidExpression(String property);
023
024    /**
025     * Return the base table this bean type maps to.
026     */
027  String getBaseTable();
028
029  /**
030   * Return the id value for the given bean.
031   */
032  Object getBeanId(T bean);
033
034  /**
035   * Return the bean persist controller.
036   */
037  BeanPersistController getPersistController();
038
039  /**
040   * Return the bean persist listener.
041   */
042  BeanPersistListener getPersistListener();
043
044  /**
045   * Return the beanFinder. Usually null unless overriding the finder.
046   */
047  BeanFindController getFindController();
048
049  /**
050   * Return the BeanQueryAdapter or null if none is defined.
051   */
052  BeanQueryAdapter getQueryAdapter();
053
054  /**
055   * Return the identity generation type.
056   */
057  IdType getIdType();
058
059  /**
060   * Return the sequence name associated to this entity bean type (if there is one).
061   */
062  String getSequenceName();
063
064}