[jbosstools-issues] [JBoss JIRA] Commented: (JBIDE-5052) Wrong generation of Hibernate XML mapping file.

Dmitry Geraskov (JIRA) jira-events at lists.jboss.org
Tue Oct 27 06:25:06 EDT 2009


    [ https://jira.jboss.org/jira/browse/JBIDE-5052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12491624#action_12491624 ] 

Dmitry Geraskov commented on JBIDE-5052:
----------------------------------------

The is not like you discribed here. The algorithm is the following:
1) look for java.lang.Number extenders and select one of them as id (the best was with name ="id" and I added "identity" as the best name too )
2) if id isn't found after step 1 select any the field with name "id" or "identity" 
3) if id isn't found after step 2 select first field
Today I removed "identity" from the best id candidates, added check that selected field has not array or collection subclass type and added step 4.
4) if id isn't found after step 3 set id to absent field with name "id"- as mapping via xml requires id.

About mappings which is not built - we are not guarantee that the mappint will be built. We just generate a skeleton for the developer. I think this could be a warning in the wizard.

> Wrong generation of Hibernate XML mapping file.
> -----------------------------------------------
>
>                 Key: JBIDE-5052
>                 URL: https://jira.jboss.org/jira/browse/JBIDE-5052
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: Hibernate
>    Affects Versions: 3.1.0.M4
>         Environment: WindowsXP SP2
> JBoss Tools
> Version: 3.1.0.M4
> eclipse-SDK-3.5RC3-win32.zip
> Build id: JBossTools-Update-3.1.0.M4
> JRE 1.5_08
>            Reporter: Aliaksey Nis
>            Assignee: Dmitry Geraskov
>             Fix For: 3.1.0.CR1
>
>
> EXECUTE: Create Seam 2FP EAR project.
> EXECUTE: New > Hibernate XML Mapping file.
> EXECUTE: Select authentificator class and add it.
> EXECUTE: Press Finish.
> FAILURE: Error appears in generated file.
> "The content of element type "class" must match "(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id|composite-id),discriminator?,natural-id?,(version|timestamp)?,(property|many-to-one|one-to-one|component|dynamic-component|properties|any|map|set|list|bag|idbag|array|primitive-array)*,((join*,subclass*)|joined-subclass*|union-subclass*),loader?,sql-insert?,sql-update?,sql-delete?,filter*,resultset*,(query|sql-query)*)"."
> On element: Authenticator.hbm.xml
> In folder: seamEar-ejb/ejbModule/org/domain/seamear/session
> Location: line 6
> Vitaly said that in this generated file class id is missed. So there is an mistake in generator.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbosstools-issues mailing list