You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@metamodel.apache.org by "Kasper Sørensen (JIRA)" <ji...@apache.org> on 2014/05/31 14:35:01 UTC

[jira] [Commented] (METAMODEL-58) ColumnBuilder.asPrimaryKey() not respected when using CreateTable class

    [ https://issues.apache.org/jira/browse/METAMODEL-58?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14014635#comment-14014635 ] 

Kasper Sørensen commented on METAMODEL-58:
------------------------------------------

I posted a proposed solution. Please review : https://reviews.apache.org/r/22121/

> ColumnBuilder.asPrimaryKey() not respected when using CreateTable class
> -----------------------------------------------------------------------
>
>                 Key: METAMODEL-58
>                 URL: https://issues.apache.org/jira/browse/METAMODEL-58
>             Project: Metamodel
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Kasper Sørensen
>            Assignee: Kasper Sørensen
>              Labels: starter
>             Fix For: 4.1
>
>
> If I create a table like this:
> DataContext dc = ...
> dc.executeUpdate(new CreateTable(...).withColumn("foo").asPrimaryKey()...);
> then the "foo" column's primary key aspect is not respected and the table gets created without any PK.
> I found the issue to be that CreateTable is using this method:
> AbstractColumnBuilder.like(Column)
> And in this method we do not properly check the primary key flag and set it if appropriate.
> It should be easy to fix, and quite important!



--
This message was sent by Atlassian JIRA
(v6.2#6252)