Note that there are some explanatory texts on larger screens.

plurals
  1. POGrails - a conditional mapping
    primarykey
    data
    text
    <p>Currently I'm developing a webapp which uses Oracle as a database. I've already been informed that my webapp has to work also on Sybase ASE. My Oracle database uses sequences to generate IDs and I mapped my domain classes to use those sequences. As far I know Sybase ASE doesn't have sequences but identities. And here is my problem. What to do with code/configuration to work with Oracle and Sybase. Some "conditional mapping" of ID for each domain would do. </p> <p>I just don't want to comment/uncomment lines in mappings every time when I'm building webapp for other database than already mapped. <strong>Have anybody any idea what to do?</strong></p> <p>There is another danger: another differences between Oracle and Sybase which have influence on mapping (I don't generate database structure using <code>dbCreate = "create"</code>) . At this point I don't see anything. <strong>Any experiences?</strong></p> <hr> <p><strong>EDIT:</strong> It turned out that it's not possible make one mapping for both databases. My Oracle structure uses quotes in column and table names. And quotes are not allowed in Sybase ASE. My (not nice and pretty) solution is changing (comment/uncomment) mapping when building webapp on some particular platform.</p> <p>Btw I'm huge fan of Grails and this mapping thing seems to be a drawback. If I was using "pure" Hibernate I'd have two mappings in xml files and I'd change them depending on an underlying database. But Grails doesn't give me possibility to have two mappings.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload