DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Key: NUCJPA-117
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Andy Jefferson
Reporter: Guillaume Houdmon
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
DataNucleus API JPA

CollectionTable name not used if also specifying @Column

Created: 03/Mar/11 05:04 PM   Updated: 28/Mar/11 06:29 PM   Resolved: 09/Mar/11 02:32 PM
Component/s: API
Affects Version/s: 3.0.0.m1
Fix Version/s: 2.1.8, 3.0.0.m3

File Attachments: 1. Zip Archive (4 kB)

Datastore: MySQL
Severity: Development

 Description  « Hide
@CollectionTable name attribute is not used to map the table.


public class Table ... {

  @CollectionTable(name = "mytable_property", joinColumns = @JoinColumn(name = "id_mytable"))
  @Column(name = "value")
  @MapKeyColumn(name = "name")
  private Map<String, String> properties = ...

The sql table is "TABLE_STRING" instead of "mytable_property".

Andy Jefferson added a comment - 03/Mar/11 05:21 PM
When I run simple testcases with @ElementCollection and @CollectionTable whether the field is Set or Map I get the join table with the correct name that I specified.

As the front page of JIRA, please provide a testcase that demonstrates what you are seeing, as per

Andy Jefferson made changes - 03/Mar/11 05:21 PM
Field Original Value New Value
Priority Minor [ 4 ] Incomplete [ 6 ]
Guillaume Houdmon added a comment - 09/Mar/11 01:37 PM
Test case.

Guillaume Houdmon made changes - 09/Mar/11 01:37 PM
Attachment [ 11380 ]
Andy Jefferson added a comment - 09/Mar/11 02:32 PM
Reproduced, thx, due to the additional @Column (which can also provide a table name, for other things). SVN for 2.x and 3.x fix this

Andy Jefferson made changes - 09/Mar/11 02:32 PM
Status Open [ 1 ] Resolved [ 5 ]
Assignee Andy Jefferson [ andy ]
Fix Version/s 2.1.8 [ 11186 ]
Fix Version/s 3.0.0.m3 [ 11193 ]
Resolution Fixed [ 1 ]
Andy Jefferson made changes - 09/Mar/11 02:43 PM
Summary CollectionTable name not used CollectionTable name not used if also specifying @Column
Priority Incomplete [ 6 ] Major [ 3 ]
Andy Jefferson made changes - 28/Mar/11 06:29 PM
Status Resolved [ 5 ] Closed [ 6 ]