[hibernate-issues] [Hibernate-JIRA] Closed: (HBX-149) Meta attributes "class-description" and "extra-import" are not generated in POJO classes

Steve Ebersole (JIRA) noreply at atlassian.com
Mon Mar 21 13:00:56 EDT 2011


     [ http://opensource.atlassian.com/projects/hibernate/browse/HBX-149?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Ebersole closed HBX-149.
------------------------------


Closing stale resolved issues

> Meta attributes "class-description" and "extra-import" are not generated in POJO classes
> ----------------------------------------------------------------------------------------
>
>                 Key: HBX-149
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-149
>             Project: Hibernate Tools
>          Issue Type: Bug
>          Components: hbm2java
>    Affects Versions: 3.0alpha3
>         Environment: Linux O.S, JDK 1.4 + JDK 1.5 (for ejb-api and metada)
>            Reporter: Hugo Ferreira
>             Fix For: 3.1alpha5
>
>
> I am using the <meta> tag to generate some code. The attributes "class-code" and "extra-attribute" seem to be ignored. The <meta>
> "class-description" however works. I have included here: mapping of one of the classes, the configuration file and the Ant logging. 
> I can also make the srource available. 
> HTHs,
> Hibernate version: 
> ..................
>  Hibernate 3.0 CVS 
>  HibernateExt 3.0 CVS 
> Mapping Document:
> .................
> <?xml version="1.0"?>
> <!DOCTYPE hibernate-mapping PUBLIC 
> 	"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
> 	"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
> <hibernate-mapping 
> 	package="pt">
> <!--        where="g1&lt;=s.getAccessRights(&quot;browser.actor&quot;)[0] AND g2&lt;=2" -->
> <!--        where="g1&lt;={this.s.getAccessRights(&quot;browser.actor&quot;)[0]} AND g2&lt;=2" -->
>     <class
>         name="Child"
>         table="browser.actor"
>         dynamic-update="false"
>         dynamic-insert="false"
>         select-before-update="false"
>         optimistic-lock="version"
>     >
>     
>        <meta attribute="class-description"> 
>           Class generated via hbm2java.
>           Meta generated session aware 
>           constructor is included.
>           
>           @author hbm2java
>         </meta>
>         
> 		<meta attribute="extra-import">uy.Session</meta>
>          
>          <meta attribute="class-code">
> 			<![CDATA[ 
> 	private String user;
> 	private int    access_per_group;
> 	
>     public Child(Session s) {
>     	user = s.getUser();
>     	int[] access = (int[])s.getAccessRights("browser.actor");
>     	
> 		setG1( new Integer( access[0] ) );
> 		setG2( new Integer( access[1] ) );
> 		//setG3( new Integer( access[2] ) );
> 		//setG4( new Integer( access[3] ) );
> 		//setG5( new Integer( access[4] ) );
> 		//setG6( new Integer( access[5] ) );
> 		//setG7( new Integer( access[6] ) );
>     }
>             ]]>
>          </meta>
>          
>         <id
>             name="id"
>             column="idactor"
>             type="long"
>         >
>             <generator class="sequence">
>                 <param name="sequence">idactor_seq</param>
>             </generator>
>         </id>
>         <property
>             name="name"
>             type="string"
>             update="true"
>             insert="true"
>             access="property"
>             column="nameac"
>         />
>         <property
>             name="email"
>             type="string"
>             update="true"
>             insert="true"
>             access="property"
>             column="email"
>         />
>         <property
>             name="address"
>             type="string"
>             update="true"
>             insert="true"
>             access="property"
>             column="address"
>         />
> <!--             not-null="true" -->
> 		<many-to-one
>             name="accommodationType"
>             class="Parent"
>             cascade="save-update"
>             outer-join="auto"
>             update="true"
>             insert="true"
>             access="property"
>             column="typela"
>         />
>         <property
>             name="community"
>             type="integer"
>             update="true"
>             insert="true"
>             access="property"
>             column="community"
>         />
>         <property
>             name="g1"
>             type="integer"
>             update="true"
>             insert="true"
>             access="property"
>             column="g1"
>         />
>         <property
>             name="g2"
>             type="integer"
>             update="true"
>             insert="true"
>             access="property"
>             column="g2"
>         />
>         
>     </class>
> 		
> </hibernate-mapping>
> Configuration File:
> ....................
> <!DOCTYPE hibernate-configuration PUBLIC
> 	"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
> 	"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
> <hibernate-configuration>
> 	<!-- name="linkall" : will cause a JNDI look-up -->
> 	<session-factory >
> 		<!-- properties -->
> 		<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
> 		<property name="show_sql">true</property>
> 		<property name="use_outer_join">true</property>
> 		
> 		<property name="connection.username">hugof</property>
> 		<property name="connection.driver_class">org.postgresql.jdbc2.optional.PoolingDataSource</property>
> 		<property name="connection.url">jdbc:postgresql://localhost/browser</property>
> 		<!-- mapping files -->
> 		<mapping resource="pt/Child.hbm.xml"/>
> 		<mapping resource="pt/Parent.hbm.xml"/>
> 		
> 		<!-- <listener type="load" class="uy.loadListener"/> -->
> 		<!-- <listener type="delete" class="uy.deleteListener"/> -->
> 		<!-- ERROR <listener type="save-update" class="uy.persistListener"/> -->
> 		<!-- <listener type="save-update" class="DefaultSaveListener"/> -->
> 		<!-- <listener type="pre-load" class="uy.preLoadListener"/> -->
> 		<!-- <listener type="pre-delete" class="uy.preDeleteListener"/> -->
> 		
> 	</session-factory>
> 	
> </hibernate-configuration>
> Ant Log:
> ........
> Buildfile: /home/hugof/workspace/hiber3/build.xml
> generatesources:
> [hibernatetool] Executing org.hibernate.tool.ant.Hbm2JavaGeneratorTask at e2cb55
> [hibernatetool] 18 Mar 2005 13:09:10.502 [INFO] [main] [org.hibernate.cfg.Environment] - Hibernate 3.0rc1
> [hibernatetool] 18 Mar 2005 13:09:10.507 [INFO] [main] [org.hibernate.cfg.Environment] - hibernate.properties not found
> [hibernatetool] 18 Mar 2005 13:09:10.519 [INFO] [main] [org.hibernate.cfg.Environment] - using CGLIB reflection optimizer
> [hibernatetool] 18 Mar 2005 13:09:10.523 [INFO] [main] [org.hibernate.cfg.Environment] - using JDK 1.4 java.sql.Timestamp handling
> [hibernatetool] 18 Mar 2005 13:09:10.537 [INFO] [main] [org.hibernate.cfg.Configuration] - Mapping file: /home/hugof/workspace/hiber3/src/pt/Child.hbm.xml
> [hibernatetool] 18 Mar 2005 13:09:10.649 [DEBUG] [main] [org.hibernate.util.DTDEntityResolver] - trying to locate http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd in classpath under org/hibernate/
> [hibernatetool] 18 Mar 2005 13:09:10.651 [DEBUG] [main] [org.hibernate.util.DTDEntityResolver] - found http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd in classpath
> [hibernatetool] 18 Mar 2005 13:09:10.923 [INFO] [main] [org.hibernate.cfg.HbmBinder] - Mapping class: pt.Child -> browser.actor
> [hibernatetool] 18 Mar 2005 13:09:10.941 [DEBUG] [main] [org.hibernate.cfg.HbmBinder] - Mapped property: id -> idactor
> [hibernatetool] 18 Mar 2005 13:09:10.973 [DEBUG] [main] [org.hibernate.cfg.HbmBinder] - Mapped property: name -> nameac
> [hibernatetool] 18 Mar 2005 13:09:10.977 [DEBUG] [main] [org.hibernate.cfg.HbmBinder] - Mapped property: email -> email
> [hibernatetool] 18 Mar 2005 13:09:10.979 [DEBUG] [main] [org.hibernate.cfg.HbmBinder] - Mapped property: address -> address
> [hibernatetool] 18 Mar 2005 13:09:11.149 [DEBUG] [main] [org.hibernate.cfg.HbmBinder] - Mapped property: accommodationType -> typela
> [hibernatetool] 18 Mar 2005 13:09:11.151 [DEBUG] [main] [org.hibernate.cfg.HbmBinder] - Mapped property: community -> community
> [hibernatetool] 18 Mar 2005 13:09:11.154 [DEBUG] [main] [org.hibernate.cfg.HbmBinder] - Mapped property: g1 -> g1
> [hibernatetool] 18 Mar 2005 13:09:11.157 [DEBUG] [main] [org.hibernate.cfg.HbmBinder] - Mapped property: g2 -> g2
> [hibernatetool] 18 Mar 2005 13:09:11.159 [INFO] [main] [org.hibernate.cfg.Configuration] - Mapping file: /home/hugof/workspace/hiber3/src/pt/Parent.hbm.xml
> [hibernatetool] 18 Mar 2005 13:09:11.164 [DEBUG] [main] [org.hibernate.util.DTDEntityResolver] - trying to locate http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd in classpath under org/hibernate/
> [hibernatetool] 18 Mar 2005 13:09:11.167 [DEBUG] [main] [org.hibernate.util.DTDEntityResolver] - found http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd in classpath
> [hibernatetool] 18 Mar 2005 13:09:11.318 [INFO] [main] [org.hibernate.cfg.HbmBinder] - Mapping class: pt.Parent -> browser.typelocalactor
> [hibernatetool] 18 Mar 2005 13:09:11.320 [DEBUG] [main] [org.hibernate.cfg.HbmBinder] - Mapped property: id -> idtla
> [hibernatetool] 18 Mar 2005 13:09:11.322 [DEBUG] [main] [org.hibernate.cfg.HbmBinder] - Mapped property: name -> nametla
> [hibernatetool] 18 Mar 2005 13:09:11.324 [DEBUG] [main] [org.hibernate.cfg.HbmBinder] - Mapped property: description -> desctla
> [hibernatetool] 18 Mar 2005 13:09:11.331 [DEBUG] [main] [org.hibernate.cfg.HbmBinder] - Mapped property: children
> [hibernatetool] 18 Mar 2005 13:09:11.332 [DEBUG] [main] [org.hibernate.cfg.HbmBinder] - Mapped property: community -> community
> [hibernatetool] 18 Mar 2005 13:09:11.334 [DEBUG] [main] [org.hibernate.cfg.HbmBinder] - Mapped property: g1 -> g1
> [hibernatetool] 18 Mar 2005 13:09:11.336 [DEBUG] [main] [org.hibernate.cfg.HbmBinder] - Mapped property: g2 -> g2
> [hibernatetool] 18 Mar 2005 13:09:11.497 [DEBUG] [main] [org.hibernate.tool.hbm2x.template] - CommonsLogLogSystem name is 'org.hibernate.tool.hbm2x.template'
> [hibernatetool] 18 Mar 2005 13:09:11.499 [INFO] [main] [org.hibernate.tool.hbm2x.template] - **************************************************************
> [hibernatetool] 18 Mar 2005 13:09:11.500 [INFO] [main] [org.hibernate.tool.hbm2x.template] - Starting Jakarta Velocity v1.4
> [hibernatetool] 18 Mar 2005 13:09:11.501 [INFO] [main] [org.hibernate.tool.hbm2x.template] - RuntimeInstance initializing.
> [hibernatetool] 18 Mar 2005 13:09:11.503 [INFO] [main] [org.hibernate.tool.hbm2x.template] - Default Properties File: org/apache/velocity/runtime/defaults/velocity.properties
> [hibernatetool] 18 Mar 2005 13:09:11.504 [INFO] [main] [org.hibernate.tool.hbm2x.template] - Trying to use logger class org.apache.velocity.tools.generic.log.CommonsLogLogSystem
> [hibernatetool] 18 Mar 2005 13:09:11.505 [INFO] [main] [org.hibernate.tool.hbm2x.template] - Using logger class org.apache.velocity.tools.generic.log.CommonsLogLogSystem
> [hibernatetool] 18 Mar 2005 13:09:11.519 [INFO] [main] [org.hibernate.tool.hbm2x.template] - Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl)
> [hibernatetool] 18 Mar 2005 13:09:11.528 [INFO] [main] [org.hibernate.tool.hbm2x.template] - Resource Loader Instantiated: org.apache.velocity.runtime.resource.loader.FileResourceLoader
> [hibernatetool] 18 Mar 2005 13:09:11.531 [INFO] [main] [org.hibernate.tool.hbm2x.template] - FileResourceLoader : initialization starting.
> [hibernatetool] 18 Mar 2005 13:09:11.533 [INFO] [main] [org.hibernate.tool.hbm2x.template] - FileResourceLoader : adding path '.'
> [hibernatetool] 18 Mar 2005 13:09:11.535 [INFO] [main] [org.hibernate.tool.hbm2x.template] - FileResourceLoader : initialization complete.
> [hibernatetool] 18 Mar 2005 13:09:11.570 [INFO] [main] [org.hibernate.tool.hbm2x.template] - Resource Loader Instantiated: org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
> [hibernatetool] 18 Mar 2005 13:09:11.572 [INFO] [main] [org.hibernate.tool.hbm2x.template] - ClasspathResourceLoader : initialization starting.
> [hibernatetool] 18 Mar 2005 13:09:11.573 [INFO] [main] [org.hibernate.tool.hbm2x.template] - ClasspathResourceLoader : initialization complete.
> [hibernatetool] 18 Mar 2005 13:09:11.578 [INFO] [main] [org.hibernate.tool.hbm2x.template] - ResourceCache : initialized. (class org.apache.velocity.runtime.resource.ResourceCacheImpl)
> [hibernatetool] 18 Mar 2005 13:09:11.580 [INFO] [main] [org.hibernate.tool.hbm2x.template] - Default ResourceManager initialization complete.
> [hibernatetool] 18 Mar 2005 13:09:11.585 [INFO] [main] [org.hibernate.tool.hbm2x.template] - Loaded System Directive: org.apache.velocity.runtime.directive.Literal
> [hibernatetool] 18 Mar 2005 13:09:11.593 [INFO] [main] [org.hibernate.tool.hbm2x.template] - Loaded System Directive: org.apache.velocity.runtime.directive.Macro
> [hibernatetool] 18 Mar 2005 13:09:11.600 [INFO] [main] [org.hibernate.tool.hbm2x.template] - Loaded System Directive: org.apache.velocity.runtime.directive.Parse
> [hibernatetool] 18 Mar 2005 13:09:11.608 [INFO] [main] [org.hibernate.tool.hbm2x.template] - Loaded System Directive: org.apache.velocity.runtime.directive.Include
> [hibernatetool] 18 Mar 2005 13:09:11.613 [INFO] [main] [org.hibernate.tool.hbm2x.template] - Loaded System Directive: org.apache.velocity.runtime.directive.Foreach
> [hibernatetool] 18 Mar 2005 13:09:11.858 [INFO] [main] [org.hibernate.tool.hbm2x.template] - Created: 20 parsers.
> [hibernatetool] 18 Mar 2005 13:09:11.882 [INFO] [main] [org.hibernate.tool.hbm2x.template] - Velocimacro : initialization starting.
> [hibernatetool] 18 Mar 2005 13:09:11.884 [INFO] [main] [org.hibernate.tool.hbm2x.template] - Velocimacro : adding VMs from VM library template : VM_global_library.vm
> [hibernatetool] 18 Mar 2005 13:09:11.897 [ERROR] [main] [org.hibernate.tool.hbm2x.template] - ResourceManager : unable to find resource 'VM_global_library.vm' in any resource loader.
> [hibernatetool] 18 Mar 2005 13:09:11.899 [INFO] [main] [org.hibernate.tool.hbm2x.template] - Velocimacro : error using  VM library template VM_global_library.vm : org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'VM_global_library.vm'
> [hibernatetool] 18 Mar 2005 13:09:11.901 [INFO] [main] [org.hibernate.tool.hbm2x.template] - Velocimacro :  VM library template macro registration complete.
> [hibernatetool] 18 Mar 2005 13:09:11.904 [INFO] [main] [org.hibernate.tool.hbm2x.template] - Velocimacro : allowInline = true : VMs can be defined inline in templates
> [hibernatetool] 18 Mar 2005 13:09:11.906 [INFO] [main] [org.hibernate.tool.hbm2x.template] - Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions
> [hibernatetool] 18 Mar 2005 13:09:11.907 [INFO] [main] [org.hibernate.tool.hbm2x.template] - Velocimacro : allowInlineLocal = false : VMs defined inline will be  global in scope if allowed.
> [hibernatetool] 18 Mar 2005 13:09:11.909 [INFO] [main] [org.hibernate.tool.hbm2x.template] - Velocimacro : messages on  : VM system will output logging messages
> [hibernatetool] 18 Mar 2005 13:09:11.910 [INFO] [main] [org.hibernate.tool.hbm2x.template] - Velocimacro : autoload off  : VM system will not automatically reload global library macros
> [hibernatetool] 18 Mar 2005 13:09:11.911 [INFO] [main] [org.hibernate.tool.hbm2x.template] - Velocimacro : initialization complete.
> [hibernatetool] 18 Mar 2005 13:09:11.913 [INFO] [main] [org.hibernate.tool.hbm2x.template] - Velocity successfully started.
> [hibernatetool] 18 Mar 2005 13:09:12.068 [INFO] [main] [org.hibernate.tool.hbm2x.template] - ResourceManager : found pojo/javaclass.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
> [hibernatetool] 18 Mar 2005 13:09:12.098 [WARN] [main] [org.hibernate.tool.hbm2x.template] - Warning! The iterative  is an Iterator in the #foreach() loop at [0,0] in template pojo/javaclass.vm. Because it's not resetable, if used in more than once, this may lead to unexpected results.
> [hibernatetool] 18 Mar 2005 13:09:12.124 [WARN] [main] [org.hibernate.tool.hbm2x.template] - Warning! The iterative  is an Iterator in the #foreach() loop at [0,0] in template pojo/javaclass.vm. Because it's not resetable, if used in more than once, this may lead to unexpected results.
> [hibernatetool] 18 Mar 2005 13:09:12.131 [INFO] [main] [org.hibernate.tool.hbm2x.POJOExporter] - Writing pt.Child to /home/hugof/workspace/hiber3/src/pt/Child.java
> [hibernatetool] 18 Mar 2005 13:09:12.213 [INFO] [main] [org.hibernate.tool.hbm2x.template] - ResourceManager : found pojo/javaclass.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
> [hibernatetool] 18 Mar 2005 13:09:12.216 [WARN] [main] [org.hibernate.tool.hbm2x.template] - Warning! The iterative  is an Iterator in the #foreach() loop at [0,0] in template pojo/javaclass.vm. Because it's not resetable, if used in more than once, this may lead to unexpected results.
> [hibernatetool] 18 Mar 2005 13:09:12.225 [WARN] [main] [org.hibernate.tool.hbm2x.template] - Warning! The iterative  is an Iterator in the #foreach() loop at [0,0] in template pojo/javaclass.vm. Because it's not resetable, if used in more than once, this may lead to unexpected results.
> [hibernatetool] 18 Mar 2005 13:09:12.230 [INFO] [main] [org.hibernate.tool.hbm2x.POJOExporter] - Writing pt.Parent to /home/hugof/workspace/hiber3/src/pt/Parent.java
> BUILD SUCCESSFUL
> Total time: 3 seconds

-- 
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