News for hackers. Stuff that matters.
Re:Databases always have a schema (2018) by Arcsech on Monday February 25, 2019 @10:55AM (#19246489)
You could use something like JOOQ[0], which (optionally) generates Java code based on your SQL schema.

[0] https://www.jooq.org/

Re:Databases always have a schema (2018) by _bxg1 on Monday February 25, 2019 @10:58AM (#19246511)
We used hibernate, which does the opposite (Java classes/annotations -> SQL). You'd still have the same disadvantages: having an imperfect "clone" of your schema.
Re:Databases always have a schema (2018) by Jyaif on Monday February 25, 2019 @11:14AM (#19246619)
Can you elaborate what you mean by "imperfect"?
Re:Databases always have a schema (2018) by _bxg1 on Monday February 25, 2019 @11:40AM (#19246825)
A 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.
Re:Databases always have a schema (2018) by threeseed on Monday February 25, 2019 @05:55PM (#19250291)
But 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.