[Modeler] DbEntity:Primery Key:PK Generation Strategy - Is there any option for natural primary key?

From: gilbertoca (gilbertoc..mail.com)
Date: Wed Sep 09 2009 - 17:29:33 EDT

  • Next message: Aristedes Maniatis: "Re: [Modeler] DbEntity:Primery Key:PK Generation Strategy - Is there any option for natural primary key?"

    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".

    Regards,

    Gilberto

    [1]http://cwiki.apache.org/confluence/display/CAY/Mapping+Primary+Keys

    -- 
    View this message in context: http://www.nabble.com/-Modeler--DbEntity%3APrimery-Key%3APK-Generation-Strategy---Is-there-any-option-for-natural-primary-key--tp25373490p25373490.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
    



    This archive was generated by hypermail 2.0.0 : Wed Sep 09 2009 - 17:30:10 EDT