V
V
Vetal Matitskiy2015-04-30 11:22:19
Java
Vetal Matitskiy, 2015-04-30 11:22:19

What comes first when developing a java application: a database or an entity?

Good afternoon, dear Java gurus
, please tell me which practice is more popular / correct? When is a set of java entities generated from a ready-made database structure, or when developers initially write all java entities by hand, and then spring / hibernate generates a database structure based on them?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
P
Power, 2015-04-30
@Power

Both are primary. It is necessary to design entities and base at the same time. For it is with entities that you work in code, so they should be convenient; but you also need to think about their representation in the database so that an inefficient solution does not turn out.
Personally, I first describe the entities in the code, then I run the database schema generator on them and check the result. If everything suits me - OK, if not, I correct the entities, file the annotations and repeat the process.

S
SaertiS, 2015-04-30
@SaertiS

In smart books, they still recommend starting from the base, and not from auto generators from various ORMs. But no one can stop you, of course.

S
sim3x, 2015-04-30
@sim3x

popular
the faster the software is created, the better

E
Eugene, 2015-04-30
@zolt85

In general, I’m probably a “village” in these matters, because I first describe the database, then I describe the entity in the code with my hands, no one generates anything for me. And rightly so, I think.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question