Module io.ebean.api

Package io.ebean


package io.ebean
Core API (see Database, DB and Query).

Database

Provides the main API for fetching and persisting beans. We can obtain the "default database" via DB.getDefault() or just use methods on DB.



// Example find by id

Order order = DB.find(Order.class, 10);


// Example save

Customer customer = DB.getReference(Customer.class, 42);

Order newOrder = new Order();
newOrder.setStatus(Order.Status.NEW);
newOrder.setCustomer(customer);
...

DB.save(newOrder);


// Example: Eagerly fetching associations

// fetch Customer 42 including their billing and shipping addresses
Customer customer = DB.find(Customer.class)
		.setId(42)
		.fetch("billingAddress")
		.fetch("shippingAddress")
		.findOne();

Address billAddr = customer.getBillingAddress();
Address shipAddr = customer.getShippingAddress();

  • Class
    Description
    Thrown when failing to acquire a pessimistic lock.
    Administrative control of AutoTune during runtime.
    Background executor service for executing of tasks asynchronously.
    Provides finder functionality for use with "Dependency Injection style" use of Ebean.
    Provides finder functionality for use with "Dependency Injection style" use of Ebean.
    Provides access to the internal state of an entity bean.
    Enum to control the different cache modes for queryCache and beanCache.
    For making calls to stored procedures.
    Defines a cancelable query.
    Holds a distinct value with it's count.
    Provides the API for fetching and saving beans to a particular database.
    Creates Database instances.
    Thrown when a foreign key constraint is enforced.
    DB is a registry of Database by name.
    Bean holding the details to update the document store.
    Action to either update or delete a document from the index.
    Document storage operations.
    Query for performing native SQL queries that return DTO Bean's.
    Thrown when a duplicate is attempted on a unique constraint.
    Class to determine the ebean version.
    An empty PagedList.
    Query by Example expression.
    Expression factory for creating standard expressions for WHERE and HAVING clauses.
    An expression that is part of a WHERE or HAVING clause.
    Expression factory for creating standard expressions.
    List of Expressions that make up a where or having clause.
    The extended API for Database.
    Defines how a relationship is fetched via either normal SQL join, a eager secondary query, via lazy loading or via eagerly hitting L2 cache.
    Defines what part of the object graph to load (select and fetch clauses).
    Builds a FetchGroup by adding fetch clauses.
    Provides paths and properties for an object graph that can be used to control what parts of the object graph is fetching (select and fetch clauses) and also can be used to control JSON marshalling (what parts of the object graph are included in the JSON).
    Provides support for filtering and sorting lists of entities without going back to the database.
    Finder<I,T>
    Intended to be used as a base class for 'Finder' implementations that can then be injected or used as public static fields on the associated entity bean.
    FutureIds represents the result of a background query execution for the Id's.
    FutureList represents the result of a background query execution that will return a list of entities.
    Represents the result of a background query execution for the total row count for a query.
    Represents a Conjunction or a Disjunction.
    The type of Junction used in full text expressions.
    Used to specify the type of like matching used.
    Options used to control a merge.
    Builds a MergeOptions which is immutable and thread safe.
    A MappedSuperclass base class that provides convenience methods for inserting, updating and deleting beans.
    Owner object notified when a modification is detected.
    Represents an Order By for a Query.
    A property and its ascending descending order.
    Represents a page of results.
    Holds a list of value object pairs.
    A pair of 2 value objects.
    Defines the scope for PersistenceContext.
    Captures and wraps IOException's occurring during ElasticSearch processing etc.
    A location for profiling transactions and queries.
    Object relational query for finding a List, Set, Map or single entity bean.
    The lock type (strength) to use with query FOR UPDATE row locking.
    FOR UPDATE wait mode.
    Used to provide iteration over query results.
    The type of the query being executed.
    Used to build object graphs based on a raw SQL statement (rather than generated by Ebean).
    Builds RawSql instances from a SQL string and column mappings.
    Used with SqlQuery to process potentially large queries reading directly from the JDBC ResultSet.
    Used with SqlQuery to map raw JDBC ResultSet to objects.
    Runs DDL and SQL scripts.
    Thrown at SERIALIZABLE isolation level for non-recoverable concurrent conflict.
    Query object for performing native SQL queries that return SqlRow or directly read ResultSet using a RowMapper.
    Query mapping to single scalar values.
    Used to return raw SQL query results.
    A SqlUpdate for executing insert update or delete statements.
    The Transaction object.
    Provides a callback that can be registered with a Transaction.
    Adapter that can be extended for easier implementation of TransactionCallback.
    Holds the definition of how a transactional method should run.
    An Insert Update or Delete statement.
    An update query typically intended to perform a bulk update of many rows that match the query.
    Holds two values as the result of a difference comparison.
    Wraps a version of a @History bean.