cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gilbertoca <gilbert...@gmail.com>
Subject Re: [Modeler] DbEntity:Primery Key:PK Generation Strategy - Is there any option for natural primary key?
Date Thu, 10 Sep 2009 12:37:28 GMT


Aristedes Maniatis-2 wrote:
> 
> I don't think using meaningful primary keys is something we want to
> encourage so much that we put a checkbox in the GUI for it. 
> 
Where did you see this intention in my question?


Aristedes Maniatis-2 wrote:
> 
> The alternative method of creating them is easy enough.
> 
So, what is the difference?


Aristedes Maniatis-2 wrote:
> 
> You don't need a PK generation strategy since, as the page you reference
> states, you just need to put data in the PK field before you commit the
> object. 
> 
Again, where did you see this intention in my question? I don't think we are
talking the same thing.
Oh my God, I've forgot to mention that I modeling[1] and not doing reverse
engineer from a existent database.

I think 
DbEntity:Primery Key:->"PK Generation Strategy"  is the option I have to tel
cayenne modeler not generate any pk strategy for my table. The existent
options [Default, Database-Generated and Custom Sequence] are strategies,
but I don't want anyone! I have other alternative in Generate DB
Schema:Options->Create PK Support, but it is for all my tables and I have
only two tables with natural key.


Aristedes Maniatis-2 wrote:
> 
> It is up to you to ensure that it is unique, deal with threading and
> collisions.
> 
Are you saying that even though my table has the primary key - it doesn't
matter natural or surrogate key - cayenne won't ensure that it is unique?

One more question. While creating my DbEntities I didn't see an option for
Unique Key Constraint. Is it a manual task?

Thanks for you attention,

Gilberto

[1]http://www.nabble.com/-modeler--Generate-Database-Schema-doesn%27t-generate-every-relationship-to25276867.html
-- 
View this message in context: http://www.nabble.com/-Modeler--DbEntity%3APrimery-Key%3APK-Generation-Strategy---Is-there-any-option-for-natural-primary-key--tp25373490p25382559.html
Sent from the Cayenne - User mailing list archive at Nabble.com.


Mime
View raw message