[ 
http://mifosforge.jira.com/browse/MIFOS-2696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56864#action_56864
 ] 

Udai Gupta commented on MIFOS-2696:
-----------------------------------

NOTES: 
1) hbm2java has some limitations where it can not create the complete 
annotation model for complex Entity classes. Entities extending BusinessObject 
Class are more appropriate example for this. hbm2java does not put 
@MappedSuperClass annotation on the BussinessObject.
2) The JPA 1.0 specification does not allow you to mix access types within an 
entity or even an entity hierarchy. If you have annotated both fields and 
properties access, the behavior is undefined. I have decided to use only 
properties access(getter) for annotations. because there is an issue with lazy 
loading in hibernate using field access. 
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3718
3) There are some Entities which can be converted to Enum class. Looks for the 
subclasses of MasterDataEntity.
 

> Migrate from Hibernate XML configuratation to JPA/Entity Annotations based 
> configuration
> ----------------------------------------------------------------------------------------
>
>                 Key: MIFOS-2696
>                 URL: http://mifosforge.jira.com/browse/MIFOS-2696
>             Project: mifos
>          Issue Type: Improvement
>          Components: Configuration
>    Affects Versions: Unscheduled
>            Reporter: Udai Gupta
>            Assignee: mifosdeveloperqueue
>             Fix For: Gazelle Backlog
>
>         Attachments: hbm2jpaPOJOfromMIFOShbm.zip, HBMxml2AnnotationsHint.patch
>
>
> Hibernate, like all other object/relational mapping tools, requires metadata 
> that governs the transformation of data from one representation to the other. 
> In Hibernate 2.x mapping metadata is most of the time declared in XML text 
> files. Alternatively XDoclet can be used utilizing Javadoc source code 
> annotations together with a compile time preprocessor.
> The same kind of annotation support is now available in the standard JDK, 
> although more powerful and with better tools support. IntelliJ IDEA and 
> Eclipse for example, support auto-completion and syntax highlighting of JDK 
> 5.0 annotations which are compiled into the bytecode and read at runtime 
> using reflection. No external XML files are needed.
> The EJB3 specification recognizes the interest and the success of the 
> transparent object/relational mapping paradigm. It standardizes the basic 
> APIs and the metadata needed for any object/relational persistence mechanism. 
> Hibernate EntityManager implements the programming interfaces and lifecycle 
> rules as defined by the EJB3 persistence specification and together with 
> Hibernate Annotations offers a complete (and standalone) EJB3 persistence 
> solution on top of the mature Hibernate core.
> http://docs.jboss.org/hibernate/stable/annotations/reference/en/html_single
> There is patch attached with this issue showing how this can be achieved with 
> least modification.
> There is zip file attached with this issue which contain pojo generated by 
> hibernate tool (with EJB3 and JDK5)
> https://www.hibernate.org/hib_docs/tools/reference/en/html_single/#d0e1193
> We can not use this generated code because
>  - These POJO might be incomplete, for example query (named queries) are not 
> add due to http://opensource.atlassian.com/projects/hibernate/browse/HBX-465, 
> but adding named queries are quite simple using annotations
>  - The Classes in Mifos might not be clean POJO (which is bad but for now we 
> have to live with that)
>  - We have to be very careful while applying the annotations and removing 
> respective xml config file so that meta-data for hibernate remains same.

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

        

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Mifos-issues mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mifos-issues

Reply via email to