You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@metamodel.apache.org by "Ashish Pancholi (JIRA)" <ji...@apache.org> on 2015/01/27 13:33:34 UTC

[jira] [Created] (METAMODEL-108) How to set composite primary key?

Ashish Pancholi created METAMODEL-108:
-----------------------------------------

             Summary: How to set composite primary key?
                 Key: METAMODEL-108
                 URL: https://issues.apache.org/jira/browse/METAMODEL-108
             Project: Apache MetaModel
          Issue Type: Bug
         Environment: ubuntu, java 1.7, maven, org.eobjects.metamodel version 3.4.7
            Reporter: Ashish Pancholi



I want to create a database-table using composite primary key in Java Apache MetaModel.

I am creating database-table using below code :

org.eobjects.metamodel.create.TableCreationBuilder tableCreator;
//Getting TableCreater object from schema and table name.
tableCreator.withColumn("id").asPrimaryKey();
tableCreator.withColumn("name");
tableCreator.withColumn("address");
tableCreator.withColumn("phone");
java.io.Serializable.Table table = tableCreator.execute()

It is working fine for me. and set "id" as primary key. But I want to set composite primary key "id and name" How can I do this?




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)