1

I need to keep case sensitive my table name in postgresql. Indeed when i annotate @Table(name="SiteType") public class SiteType extends Model

My table name will be "sitetype". I try to add @Table(name="SiteType")

But eovlution default script will generate the following script problem : constraint pk_"SiteType" primary key (id))

Any suggestions?

iCode
  • 95
  • 1
  • 11
  • [Postgres supports mixed-case tablenames (and column names)](http://stackoverflow.com/questions/20878932/are-postgresql-column-names-case-sensitive) but this is strongly discouraged. I'm not sure offhand how to get Ebean to go along with non-standard tablenames like this. May I ask why this is important? – dcsohl Jan 23 '15 at 13:02
  • Because i need to retrieve my class name : SiteType from my table name. – iCode Jan 23 '15 at 13:03
  • I don't get it. Why do you need to do that? – dcsohl Jan 23 '15 at 13:05
  • Because i need to do aClass = Class.forName(TABLENAME); – iCode Jan 23 '15 at 13:09
  • Your usecase still seems dubious to me, but in that case I would suggest converting camelcase classname FooBarBaz into table name foo_bar_baz and doing that trivial conversion back and forth. So given table name `site_type` you know you're looking for class `SiteType`. – dcsohl Jan 23 '15 at 13:18

0 Answers0