Configuring BasePlugin / Database specifics

If Ebean is not recognising your specific Database you will want to configure it. You can either configure the BasePlugin through or build a specific "Plugin Class" that extends BasePlugin.


The configuration questions you will have to answer are:
Q: What are the quoted identifier strings?
The default is double quotes.
Q: Does this Database use Sequences or Identity/Autoincrement?
If it supports neither an External Id Generator must be used.
Q: Does this Database support getGeneratedKeys?
If this is not supported then you can not use statement batching transparently. Things are doable but certainly not as nice. If you have a requirement for large batch inserts then I would look closely at how you will be restrcited by this.
Q: Does this Database support ROW_NUMBER() or LIMIT or neither for limiting resultsets?
Refer to this excellent url.


Configure BasePlugin via

You can configure the BasePlugin by using

Assuming my database name is "mydb" then I could put these entries into the file.



# Default to use DB Identity/AutoIncrement, 
#   DB Sequence or External Id Generator
# identity, sequence, generator

# Limit resultsets by ROW_NUMBER() LIMIT or jdbc resultset navigation
# rownumber, limit, 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() {
        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 specify your plugin implementation for "mydb"

# Specify a specific Plugin

Introduction User Guide (pdf) Install/Configure Public JavaDoc Whitepapers
General Database Specific Byte Code Deployment Annotations Features
Top Bugs Top Enhancements