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 the base table this bean type maps to.
021   */
022  String getBaseTable();
023
024  /**
025   * Return the id value for the given bean.
026   */
027  Object getBeanId(T bean);
028
029  /**
030   * Return the bean persist controller.
031   */
032  BeanPersistController getPersistController();
033
034  /**
035   * Return the bean persist listener.
036   */
037  BeanPersistListener getPersistListener();
038
039  /**
040   * Return the beanFinder. Usually null unless overriding the finder.
041   */
042  BeanFindController getFindController();
043
044  /**
045   * Return the BeanQueryAdapter or null if none is defined.
046   */
047  BeanQueryAdapter getQueryAdapter();
048
049  /**
050   * Return the identity generation type.
051   */
052  IdType getIdType();
053
054  /**
055   * Return the sequence name associated to this entity bean type (if there is one).
056   */
057  String getSequenceName();
058
059}