3 ms·
You could use something like JOOQ[0], which (optionally) generates Java code based on your SQL schema. [0] https://www.jooq.org/ https://www.jooq.org/
by Arcsech 8y ago
You could use something like JOOQ[0], which (optionally) generates Java code based on your SQL schema.
[0] https://www.jooq.org/ https://www.jooq.org/
- _bxg1 8y agoWe used hibernate, which does the opposite (Java classes/annotations -> SQL). You'd still have the same disadvantages: having an imperfect "clone" of your schema.
- Jyaif 8y agoCan you elaborate what you mean by "imperfect"?
- _bxg1 8y agoA Java string isn't precisely the same thing as a varchar(255), for example. Nor is an ArrayList (ordered) the same thing as a set of rows (unordered). Mapping between these slightly different sets of concepts usually works well enough, but it's an additional piece of disjointedness.
- threeseed 8y agoBut it's unavoidable. At some point you have to do that translation. And I would rather leave that up to the ORM where it fundamental to what they do then reimplement it.