[jboss-jira] [JBoss JIRA] Updated: (JBPM-832) persist annotated classes by using AnnotationConfiguration in HibernateHelper.java

Tom Baeyens (JIRA) jira-events at lists.jboss.org
Wed Mar 14 08:46:33 EDT 2007


     [ http://jira.jboss.com/jira/browse/JBPM-832?page=all ]

Tom Baeyens updated JBPM-832:
-----------------------------

    Fix Version/s:  jBPM jPDL 3.2.1
                       (was: jBPM jPDL 3.2)

> persist annotated classes by using AnnotationConfiguration in HibernateHelper.java
> ----------------------------------------------------------------------------------
>
>                 Key: JBPM-832
>                 URL: http://jira.jboss.com/jira/browse/JBPM-832
>             Project: JBoss jBPM
>          Issue Type: Feature Request
>          Components: Core Engine
>    Affects Versions: jBPM jPDL 3.2 beta 1
>            Reporter: Chris Russell
>         Assigned To: Tom Baeyens
>             Fix For:  jBPM jPDL 3.2.1
>
>
> Should be able to persist annotated Entitys (classes that dont have a hbm.xml mapping file).
> To do this is a fairly simple change to HibernateHelper.java.
> One unresolved question here is why doesnt the hibernate.cfg.xml configuration option
> <property name="hibernate.ejb.naming_strategy"> 
> get picked up?? 
> HibernateHelper.java
> ..
> import org.hibernate.cfg.AnnotationConfiguration;
> import org.hibernate.cfg.DefaultComponentSafeNamingStrategy;
> .
> .
> public static Configuration createConfiguration(String cfgXmlResource, String propertiesResource) {
>       AnnotationConfiguration configuration = new AnnotationConfiguration();
>       //NOT SURE WHY BUT configuration not picking up
>       //hibernate.cfg.xml 
>      //<property name="hibernate.ejb.naming_strategy">
>      //org.hibernate.cfg.DefaultComponentSafeNamingStrategy</property>
>       log.debug("NAMING START STRATEGY ["+configuration.getNamingStrategy().getClass().getName()+"]");
>       log.debug(configuration.setNamingStrategy(new DefaultComponentSafeNamingStrategy()));
>       log.debug("NAMING AFTER STRATEGY ["+configuration.getNamingStrategy().getClass().getName()+"]");
> 	
> With these changes you can now add mappings to the hibernate.cfg.xml
> such as
> <mapping package="foo"/>
> <mapping class="foo.MyAnnotatedFooClass"/>	
> To pick up annotated classes....

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

        



More information about the jboss-jira mailing list