Bug 359 : DDL generation fails if naming convention has schema
Priority 
Medium
Reported Version 
 
Logged By 
Alex O
Status 
Fixed
Fixed Version 
2.7.3
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
09/03/2011
Updated 
09/03/2011
Type 
Bug
 
Attachments 
No attachments

If database schema is set in naming convention, DDL generation fails due to attempts to
create a primary key with invalid names. Example:

@Entity
public class Entry {
@Id Long id;
String value;
// setters, getters etc.
}

public class Test {
public static void main( String[] args ) {
ServerConfig cfg = new ServerConfig();
// .... other settings ...
UnderscoreNamingConvention naming = new
UnderscoreNamingConvention();
naming.setSchema("foo");
cfg.setNamingConvention( naming );
cfg.setDdlGenerate( true );
cfg.setDdlRun( true );
EbeanServer ebean = EbeanServerFactory.create( cfg );
}
}

Generated DDL attempts to create constraint pk_foo.entry instead of
foo.pk_entry for table foo.entry:
create table foo.entry (
id bigint not null,
value varchar(255),
constraint pk_foo.entry primary key (id))
;

create sequence foo.entry_seq;

 
Rob 16 Mar 07:27
Fixed in HEAD

Fixed in HEAD.

woResponse

Upload a file