mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-03 16:25:36 +00:00
Added @Index annotation to generate single-column indexes
This commit is contained in:
1 parent
11a6cd04ea
commit
31f56621ff
8 files changed
+246
-94
No files matched your search
@@ -8,21 +8,21 @@ import com.avaje.tests.model.basic.EBasic;
|
||||
|
||||
public class MainDdlWithSchema {
|
||||
|
||||
public static void main(String[] args) {
|
||||
public static void main(String[] args) {
|
||||
|
||||
ServerConfig cfg = new ServerConfig();
|
||||
cfg.setName("pg");
|
||||
cfg.loadFromProperties();
|
||||
cfg.addClass(EBasic.class);
|
||||
|
||||
// .... other settings ...
|
||||
UnderscoreNamingConvention naming = new UnderscoreNamingConvention();
|
||||
naming.setSchema("foo");
|
||||
cfg.setNamingConvention(naming);
|
||||
cfg.setDdlGenerate(true);
|
||||
cfg.setDdlRun(true);
|
||||
EbeanServer ebean = EbeanServerFactory.create(cfg);
|
||||
//ebean.createSqlUpdate("create schema foo").execute();
|
||||
System.out.println(ebean);
|
||||
}
|
||||
ServerConfig cfg = new ServerConfig();
|
||||
cfg.setName("h2");
|
||||
cfg.loadFromProperties();
|
||||
cfg.addClass(EBasic.class);
|
||||
|
||||
// .... other settings ...
|
||||
//UnderscoreNamingConvention naming = new UnderscoreNamingConvention();
|
||||
//naming.setSchema("test");
|
||||
//cfg.setNamingConvention(naming);
|
||||
cfg.setDdlGenerate(true);
|
||||
cfg.setDdlRun(true);
|
||||
EbeanServer ebean = EbeanServerFactory.create(cfg);
|
||||
//ebean.createSqlUpdate("create schema foo").execute();
|
||||
System.out.println(ebean);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user