Package io.ebean.config.dbplatform
Class DbIdentity
- java.lang.Object
-
- io.ebean.config.dbplatform.DbIdentity
-
public class DbIdentity extends Object
Defines the identity/sequence behaviour for the database.
-
-
Constructor Summary
Constructors Constructor Description DbIdentity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IdTypegetIdType()Return the default ID generation type that should be used.StringgetSelectLastInsertedId(String table)Return the SQL query to find the SelectLastInsertedId.booleanisSupportsGetGeneratedKeys()Return true if GetGeneratedKeys is supported.booleanisSupportsIdentity()Return true if this DB platform supports identity (autoincrement).booleanisSupportsSequence()Return true if the database supports sequences.voidsetIdType(IdType idType)Set the default ID generation type that should be used.voidsetSelectLastInsertedIdTemplate(String selectLastInsertedIdTemplate)Set the template used to build the SQL query to return the LastInsertedId.voidsetSupportsGetGeneratedKeys(boolean supportsGetGeneratedKeys)Set if GetGeneratedKeys is supported.voidsetSupportsIdentity(boolean supportsIdentity)Set to true if this DB platform supports identity (autoincrement).voidsetSupportsSequence(boolean supportsSequence)Set to true if the database supports sequences.
-
-
-
Constructor Detail
-
DbIdentity
public DbIdentity()
-
-
Method Detail
-
isSupportsGetGeneratedKeys
public boolean isSupportsGetGeneratedKeys()
Return true if GetGeneratedKeys is supported.GetGeneratedKeys required to support JDBC batching transparently.
-
setSupportsGetGeneratedKeys
public void setSupportsGetGeneratedKeys(boolean supportsGetGeneratedKeys)
Set if GetGeneratedKeys is supported.
-
getSelectLastInsertedId
public String getSelectLastInsertedId(String table)
Return the SQL query to find the SelectLastInsertedId.This should only be set on databases that don't support GetGeneratedKeys.
-
setSelectLastInsertedIdTemplate
public void setSelectLastInsertedIdTemplate(String selectLastInsertedIdTemplate)
Set the template used to build the SQL query to return the LastInsertedId.The template can contain "{table}" where the table name should be include in the sql query.
This should only be set on databases that don't support GetGeneratedKeys.
-
isSupportsSequence
public boolean isSupportsSequence()
Return true if the database supports sequences.
-
setSupportsSequence
public void setSupportsSequence(boolean supportsSequence)
Set to true if the database supports sequences. Generally this also means you want to set the default IdType to sequence (some DB's support both sequences and identity).
-
isSupportsIdentity
public boolean isSupportsIdentity()
Return true if this DB platform supports identity (autoincrement).
-
setSupportsIdentity
public void setSupportsIdentity(boolean supportsIdentity)
Set to true if this DB platform supports identity (autoincrement).
-
getIdType
public IdType getIdType()
Return the default ID generation type that should be used. This should be either SEQUENCE or IDENTITY (aka Autoincrement).Note: Id properties of type UUID automatically get a UUID generator assigned to them.
-
-