Showing posts with label hibernate. Show all posts
Showing posts with label hibernate. Show all posts

Friday, February 10, 2012

naming conventions

nouns in all caps will be treated as ordinary words, including abbreviations and is subject to camel caps rules

e.g.
UUID => Uuid
DAO => Dao


Dao should also follow these rules, even in
* ClassNamesDao
* fieldNameDao
* bean id="nameDao"

- the word "name" is to be treated as a suffix, and not as a separate word
-- filename, username, firstname, lastname

Tuesday, February 7, 2012

hibernate can't target an unmapped class

-make sure the annotation is javax.persistence.Entity, and not org.hibernate.annotations.Entity. The former makes the entity detectable. The latter is just an addition.

-if you are manually listing your entities (in persistence.xml, in hibernate.cfg.xml, or when configuring your session factory), then make sure you have also listed the ScopeTopic entity

-use packagesToScan in sessionFactory rather than annotatedPackages and pass all the packages with entities

-make sure you don't have multiple ScopeTopic classes in different packages, and you've imported the wrong one.