metamodel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kasper Sørensen (JIRA) <j...@apache.org>
Subject [jira] [Resolved] (METAMODEL-131) Create table with composite primary key gives error.
Date Thu, 09 Apr 2015 09:00:30 GMT

     [ https://issues.apache.org/jira/browse/METAMODEL-131?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Kasper Sørensen resolved METAMODEL-131.
---------------------------------------
    Resolution: Fixed
      Assignee: Hosur Narahari

Fixed as of commit 1bc0887ef3853d11903259133d45e4acce10213c

Thank you Hosur :)

> Create table with composite primary key gives error.
> ----------------------------------------------------
>
>                 Key: METAMODEL-131
>                 URL: https://issues.apache.org/jira/browse/METAMODEL-131
>             Project: Apache MetaModel
>          Issue Type: Bug
>            Reporter: Hosur Narahari
>            Assignee: Hosur Narahari
>
> Creating table with primary key is not possible since while generating sql we add "PRIMARY
KEY" keyword to each column which results in error in case of composite primary keys. Below
is the code.
> context.executeUpdate(new UpdateScript() {
> 			
> 			@Override
> 			public void run(UpdateCallback callback) {
> 				callback.createTable("amass", "test").
> 				withColumn("id").ofType(ColumnType.INTEGER).ofSize(16).asPrimaryKey()
> 				.withColumn("name").ofType(ColumnType.VARCHAR).ofSize(255).asPrimaryKey()
> 				.execute();
> 			}
> 		});
> I am using mysql. Am I using it in the wrong way?



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

Mime
View raw message