java - What's the point of having complex entity classes (in the Hibernate sense) -



java - What's the point of having complex entity classes (in the Hibernate sense) -

since classic oop model broken anyway, despite goodies of orm, why need annotate next 2 illustration attributes in entity class:

user => collection<photo> photos (one many) => collection<user> friends (one many)

as not going utilize ... ever. seemingly, need paging or other types of formatting, guess i'll go like:

photodaoinstance.find(searchcriteria);

why don't restrict annotation of entity classes attributes corresponding database table contains? rest transient properties.

well, if never need them, don't map them. depending on schema/intent, there's no reason map things don't need. if need them later, add together them. depending on usage, might want add together them hql/jpa ql/criteria queries, or might want query in sql. eventually, may need rework or rethink caching performance, that's way things go. create sure have decent test suite.

no big deal. ::shrug::

generally speaking, adding things later easy. deleting isn't bad either. moving/splitting hard 1 (e.g. splitting name first , last).

java hibernate orm entity dao

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -