[hibernate-issues] [Hibernate-JIRA] Commented: (HBX-982) HBM2JAVA w/ ejb3=true does not generate @IndexColumn annotation
Sharath Reddy (JIRA)
noreply at atlassian.com
Wed Jul 22 16:30:12 EDT 2009
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-982?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=33655#action_33655 ]
Sharath Reddy commented on HBX-982:
-----------------------------------
The attached patch to EntityPOJOClass should fix this issue. Also attached a test case.
> HBM2JAVA w/ ejb3=true does not generate @IndexColumn annotation
> ---------------------------------------------------------------
>
> Key: HBX-982
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-982
> Project: Hibernate Tools
> Issue Type: Bug
> Components: hbm2java
> Affects Versions: 3.2beta10
> Environment: HibernateTools 3.2beta10
> Reporter: Parker Whirlow
> Attachments: EntityPOJOClass.patch, Hbm2JavaEjb3Test.patch
>
>
> When using the HBM2JAVA tool with 'ejb3=true' to generate EJB annotations, a hibernate mapping consisting of an ordered List doesn't generate the @IndexColumn annotation in the resulting java class. See below:
> Mapping document:
> <hibernate-mapping package="com.company.ejb3.entity">
> <union-subclass name="Person" table="person" extends="AbstractEntity">
> <property name="firstName" column="first_name" not-null="true" type="string" length="150"></property>
> <list name="addresses" table="person_addresses">
> <key column="person" />
> <list-index column="address_index" />
> <many-to-many column="address" class="Address" />
> </list>
> </union-subclass>
> </hibernate-mapping>
> Resulting Person.java snippet:
> @ManyToMany(fetch=FetchType.LAZY)
> @JoinTable(name="person_addresses", joinColumns = {
> @JoinColumn(name="person", nullable=false, updatable=false) }, inverseJoinColumns = {
> @JoinColumn(name="address", nullable=false, updatable=false) })
> public List<Address> getAddresses() {
> return this.addresses;
> }
>
> public void setAddresses(List<Address> addresses) {
> this.addresses = addresses;
> }
> The above should contain:
> @IndexColumn(name="address_index")
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list