You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Andy Schlaikjer (JIRA)" <ji...@apache.org> on 2008/10/08 17:15:44 UTC

[jira] Created: (OPENJPA-741) default join column names are up-cased when using MySQL DBDictionary

default join column names are up-cased when using MySQL DBDictionary
--------------------------------------------------------------------

                 Key: OPENJPA-741
                 URL: https://issues.apache.org/jira/browse/OPENJPA-741
             Project: OpenJPA
          Issue Type: Bug
          Components: jdbc, third-party
    Affects Versions: 1.2.0, 1.1.0
         Environment: 64-bit Linux, Sun JDK 1.6.0_07, mysql-5.0.67-linux-x86_64-glibc23 server, mysql-connector-java 5.1.6
            Reporter: Andy Schlaikjer
            Priority: Minor


On regeneration of database using the MappingTool and the MySQL DBDictionary (did not test with other backend DBs) some column names are being up-cased by default. Not all column names; just join column names involved in @ManyToOne relations (and perhaps elsewhere..):

@Entity
public class A {
   @Id
   private long id; // generated column name is "id"

   @ManyToOne
   private A parent; // generated column name is "PARENT_ID"
}

I can still force the generated column name to match the desired case by explicitly setting the name attribute of a @JoinColumn annotation:

@Entity
public class A {
   @Id
   private long id; // generated column name is "id"

   @ManyToOne
   @JoinColumn(name="parent_id")
   private A parent; // generated column name is "parent_id"
}

This bug is not present in OpenJPA versions 1.0.2 nor 1.0.3, but is evident in 1.2.0 and 1.3.0.

In addition, it seems join column names in collection tables are also affected:

@Entity
public class A {
  @Id
  private long id;

  @PersistentCollection
  @CollectionTable
  private Set<String> strings; // generated table "A_strings" has join column "A_ID"
}

@Entity
public class A {
  @Id
  private long id;

  @PersistentCollection
  @CollectionTable(joinColumns = { @XJoinColumn(name = "A_id") })
  private Set<String> strings; // generated table "A_strings" has join column "A_id"
}

This issue was first discussed in an email thread on openjpa-user mailing list:

http://thread.gmane.org/gmane.comp.apache.openjpa.user/2846


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (OPENJPA-741) default join column names are up-cased when using MySQL DBDictionary

Posted by "Albert Lee (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-741?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Albert Lee reassigned OPENJPA-741:
----------------------------------

    Assignee: Albert Lee

> default join column names are up-cased when using MySQL DBDictionary
> --------------------------------------------------------------------
>
>                 Key: OPENJPA-741
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-741
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc, third-party
>    Affects Versions: 1.1.0, 1.2.0
>         Environment: 64-bit Linux, Sun JDK 1.6.0_07, mysql-5.0.67-linux-x86_64-glibc23 server, mysql-connector-java 5.1.6
>            Reporter: Andy Schlaikjer
>            Assignee: Albert Lee
>            Priority: Minor
>
> On regeneration of database using the MappingTool and the MySQL DBDictionary (did not test with other backend DBs) some column names are being up-cased by default. Not all column names; just join column names involved in @ManyToOne relations (and perhaps elsewhere..):
> @Entity
> public class A {
>    @Id
>    private long id; // generated column name is "id"
>    @ManyToOne
>    private A parent; // generated column name is "PARENT_ID"
> }
> I can still force the generated column name to match the desired case by explicitly setting the name attribute of a @JoinColumn annotation:
> @Entity
> public class A {
>    @Id
>    private long id; // generated column name is "id"
>    @ManyToOne
>    @JoinColumn(name="parent_id")
>    private A parent; // generated column name is "parent_id"
> }
> This bug is not present in OpenJPA versions 1.0.2 nor 1.0.3, but is evident in 1.2.0 and 1.3.0.
> In addition, it seems join column names in collection tables are also affected:
> @Entity
> public class A {
>   @Id
>   private long id;
>   @PersistentCollection
>   @CollectionTable
>   private Set<String> strings; // generated table "A_strings" has join column "A_ID"
> }
> @Entity
> public class A {
>   @Id
>   private long id;
>   @PersistentCollection
>   @CollectionTable(joinColumns = { @XJoinColumn(name = "A_id") })
>   private Set<String> strings; // generated table "A_strings" has join column "A_id"
> }
> This issue was first discussed in an email thread on openjpa-user mailing list:
> http://thread.gmane.org/gmane.comp.apache.openjpa.user/2846

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (OPENJPA-741) default join column names are up-cased when using MySQL DBDictionary

Posted by "Albert Lee (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-741?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Albert Lee reassigned OPENJPA-741:
----------------------------------

    Assignee:     (was: Albert Lee)

> default join column names are up-cased when using MySQL DBDictionary
> --------------------------------------------------------------------
>
>                 Key: OPENJPA-741
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-741
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc, third-party
>    Affects Versions: 1.1.0, 1.2.0
>         Environment: 64-bit Linux, Sun JDK 1.6.0_07, mysql-5.0.67-linux-x86_64-glibc23 server, mysql-connector-java 5.1.6
>            Reporter: Andy Schlaikjer
>            Priority: Minor
>
> On regeneration of database using the MappingTool and the MySQL DBDictionary (did not test with other backend DBs) some column names are being up-cased by default. Not all column names; just join column names involved in @ManyToOne relations (and perhaps elsewhere..):
> @Entity
> public class A {
>    @Id
>    private long id; // generated column name is "id"
>    @ManyToOne
>    private A parent; // generated column name is "PARENT_ID"
> }
> I can still force the generated column name to match the desired case by explicitly setting the name attribute of a @JoinColumn annotation:
> @Entity
> public class A {
>    @Id
>    private long id; // generated column name is "id"
>    @ManyToOne
>    @JoinColumn(name="parent_id")
>    private A parent; // generated column name is "parent_id"
> }
> This bug is not present in OpenJPA versions 1.0.2 nor 1.0.3, but is evident in 1.2.0 and 1.3.0.
> In addition, it seems join column names in collection tables are also affected:
> @Entity
> public class A {
>   @Id
>   private long id;
>   @PersistentCollection
>   @CollectionTable
>   private Set<String> strings; // generated table "A_strings" has join column "A_ID"
> }
> @Entity
> public class A {
>   @Id
>   private long id;
>   @PersistentCollection
>   @CollectionTable(joinColumns = { @XJoinColumn(name = "A_id") })
>   private Set<String> strings; // generated table "A_strings" has join column "A_id"
> }
> This issue was first discussed in an email thread on openjpa-user mailing list:
> http://thread.gmane.org/gmane.comp.apache.openjpa.user/2846

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-741) default join column names are up-cased when using MySQL DBDictionary

Posted by "Albert Lee (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-741?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12638318#action_12638318 ] 

Albert Lee commented on OPENJPA-741:
------------------------------------

I shall take a look and reproduce the problem. Stay tune.

Albert Lee.

> default join column names are up-cased when using MySQL DBDictionary
> --------------------------------------------------------------------
>
>                 Key: OPENJPA-741
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-741
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc, third-party
>    Affects Versions: 1.1.0, 1.2.0
>         Environment: 64-bit Linux, Sun JDK 1.6.0_07, mysql-5.0.67-linux-x86_64-glibc23 server, mysql-connector-java 5.1.6
>            Reporter: Andy Schlaikjer
>            Assignee: Albert Lee
>            Priority: Minor
>
> On regeneration of database using the MappingTool and the MySQL DBDictionary (did not test with other backend DBs) some column names are being up-cased by default. Not all column names; just join column names involved in @ManyToOne relations (and perhaps elsewhere..):
> @Entity
> public class A {
>    @Id
>    private long id; // generated column name is "id"
>    @ManyToOne
>    private A parent; // generated column name is "PARENT_ID"
> }
> I can still force the generated column name to match the desired case by explicitly setting the name attribute of a @JoinColumn annotation:
> @Entity
> public class A {
>    @Id
>    private long id; // generated column name is "id"
>    @ManyToOne
>    @JoinColumn(name="parent_id")
>    private A parent; // generated column name is "parent_id"
> }
> This bug is not present in OpenJPA versions 1.0.2 nor 1.0.3, but is evident in 1.2.0 and 1.3.0.
> In addition, it seems join column names in collection tables are also affected:
> @Entity
> public class A {
>   @Id
>   private long id;
>   @PersistentCollection
>   @CollectionTable
>   private Set<String> strings; // generated table "A_strings" has join column "A_ID"
> }
> @Entity
> public class A {
>   @Id
>   private long id;
>   @PersistentCollection
>   @CollectionTable(joinColumns = { @XJoinColumn(name = "A_id") })
>   private Set<String> strings; // generated table "A_strings" has join column "A_id"
> }
> This issue was first discussed in an email thread on openjpa-user mailing list:
> http://thread.gmane.org/gmane.comp.apache.openjpa.user/2846

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.