Hi Felipe,

> I think that the generic persistent is a good idea because you musn't write
> or generated the POJO for your classes, but I don't know if it's the best
> way to use Cayenne....

I'm of the opposite opinion.  Always use the generated Cayenne classes
unless you have a specific use case where you can't use them.  The
compiler can check the spelling/etc of City.class for you, but can't
check "City".  Also, if you ever rename your entity to something else,
then the compile will break everywhere the name is incorrect when you
use the generated classes.  The same applies to method
setters/getters, too.  When using strings, the compiler hasn't a clue
and you have to go hunting.  Much more error prone than using the
generated classes.


> Is recommended using Meaningful Primary Key?

In general, no, especially if you are creating a new database.
However, sometimes you are dealing with a legacy database or data from
an external source which uses meaningful primary keys.  In that case,
Cayenne still supports the practice, even though it isn't recommended
for new databases.

mrg

Reply via email to