Configure BasePlugin via system.properties
You can configure the BasePlugin by using system.properties
Assuming my database name is "mydb" then I could put these
entries into the system.properties file.
ebean.mydb.openquote=]
ebean.mydb.closequote=[
ebean.mydb.supportsGetGeneratedKeys=true
ebean.mydb.supportsSequences=false
# Default to use DB Identity/AutoIncrement,
# DB Sequence or External Id Generator
#
# identity, sequence, generator
ebean.mydb.identityGeneration=identity
# Limit resultsets by ROW_NUMBER() LIMIT or jdbc resultset navigation
#
# rownumber, limit, jdbc
ebean.mydb.resultSetLimit=jdbc
Building a Plugin (Extend BasePlugin)
Have a look at the code in com.avaje.ebean.server.plugin
Its fairly straight forward to build a plugin and this is the
Oracle10 specific plugin code.
public class Oracle10Plugin extends BasePlugin {
public Oracle10Plugin() {
super();
setPropertyDefault("namingconvention.sequence.nextvalsuffix", ".NEXTVAL");
setPropertyDefault("namingconvention.sequence.from", "FROM DUAL");
this.supportsGetGeneratedKeys = true;
this.supportsSequences = true;
this.openQuote = "\"";
this.closeQuote = "\"";
this.resultSetLimit = ResultSetLimit.RowNumber;
}
}
In system.properties specify your plugin implementation for "mydb"
# Specify a specific Plugin
#
ebean.mydb.plugin=com.avaje.ebean.server.plugin.MySpecificPlugin
|