cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gilbertoca <>
Subject [Modeler] DbEntity:Primery Key:PK Generation Strategy - Is there any option for natural primary key?
Date Wed, 09 Sep 2009 21:29:33 GMT

Hi again,

In my model I have two tables with very simple structure:
CREATE TABLE TipoVeiculo (fabricante varchar(50) NULL, 
                                              modelo varchar(20) NULL, 
                                              tipo varchar(20) NOT NULL,
PRIMARY KEY (tipo));

CREATE TABLE Veiculo (cd_cliente integer NOT NULL, 
                                       cd_tabela_preco integer NOT NULL, 
                                       cor varchar(20) NULL, 
                                       placa varchar(20) NOT NULL, 
                                       tipo varchar(20) NOT NULL, PRIMARY
KEY (placa));

VeĆ­culo (Vehicle)
Tipo (Vehicle Type)

So, as you can see both uses natural key.  When choosing DbEntity:Primery
Key:->"PK Generation Strategy" I can't see any option for natural key!
Other thing, is this one[1] the unique way to create a getter or setter for
primary keys in the generate Java classes? I was looking for an option on
ObjEntity->attributes tab->tool bar, something like "Expose Primary Key".



View this message in context:
Sent from the Cayenne - User mailing list archive at

View raw message