You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ode.apache.org by "Jeff Yu (JIRA)" <ji...@apache.org> on 2009/11/18 09:54:39 UTC

[jira] Created: (ODE-704) clean up the JPA module, supports botht openJPA and Hibernate

clean up the JPA module, supports botht openJPA and Hibernate
-------------------------------------------------------------

                 Key: ODE-704
                 URL: https://issues.apache.org/jira/browse/ODE-704
             Project: ODE
          Issue Type: Improvement
          Components: BPEL Runtime
    Affects Versions: 1.3.3
            Reporter: Jeff Yu
             Fix For: 2.0


see this thread for detail.

http://mail-archives.apache.org/mod_mbox/ode-dev/200911.mbox/%3C436a94770911160003m682f1678ra9bd9f00fdc49763@mail.gmail.com%3E

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ODE-704) clean up the JPA module, supports botht openJPA and Hibernate

Posted by "Rafal Rusin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12803059#action_12803059 ] 

Rafal Rusin commented on ODE-704:
---------------------------------

I think that we will end up with two separate dao-jpa modules, one for hibernate and one for openjpa. This is because there are small differences in implementations of those two. 
However I think it's better idea to have two JPA modules, which are slightly different than HIB and JPA, which are totally different.

> clean up the JPA module, supports botht openJPA and Hibernate
> -------------------------------------------------------------
>
>                 Key: ODE-704
>                 URL: https://issues.apache.org/jira/browse/ODE-704
>             Project: ODE
>          Issue Type: Improvement
>          Components: BPEL Runtime
>    Affects Versions: 1.3.3
>            Reporter: Jeff Yu
>             Fix For: 2.0
>
>
> see this thread for detail.
> http://mail-archives.apache.org/mod_mbox/ode-dev/200911.mbox/%3C436a94770911160003m682f1678ra9bd9f00fdc49763@mail.gmail.com%3E

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ODE-704) clean up the JPA module, supports botht openJPA and Hibernate

Posted by "Jeff Yu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12841082#action_12841082 ] 

Jeff Yu commented on ODE-704:
-----------------------------

Hi Aaron,

Thought it is better that we put discussion on the maillist, so I forwarded your questions and replied them on http://ode.markmail.org/message/s7hngiwsgs7afyyd?q=JPA+DAO+refactoring

Regards
Jeff

> clean up the JPA module, supports botht openJPA and Hibernate
> -------------------------------------------------------------
>
>                 Key: ODE-704
>                 URL: https://issues.apache.org/jira/browse/ODE-704
>             Project: ODE
>          Issue Type: Improvement
>          Components: BPEL Runtime
>    Affects Versions: 1.3.3
>            Reporter: Jeff Yu
>            Assignee: Jeff Yu
>             Fix For: 2.0
>
>
> see this thread for detail.
> http://mail-archives.apache.org/mod_mbox/ode-dev/200911.mbox/%3C436a94770911160003m682f1678ra9bd9f00fdc49763@mail.gmail.com%3E

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ODE-704) clean up the JPA module, supports botht openJPA and Hibernate

Posted by "Jeff Yu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12783685#action_12783685 ] 

Jeff Yu commented on ODE-704:
-----------------------------

I did some experiments based on Ode 1.3.3 last week.
Below is the couple steps that we need to do.

1. Refactor the dao-jpa module, pull out two JPA's API into the dao-jpa-ojpa module, and then introduce a Factory class to produce the corresponding DAO class for OpenJPA and Hibernate, added another dao-jpa-hibernate module for the Hibernate's specific classes.
2. Need to update the buildr/hibernate.rb class to generate database script by using hibernate built-in tool (known as hbm2ddl).
3. Need to separate the bpel-store module into two different modules. Currently this module has four DAO classes, and they put both the JPA and Hibernate impl into same jar with different package name. One issue is that in its produced jar, it will include the *.hbm.xml file, these files will get loaded in our JBoss by default, which means if we configure the jpa to use Hibernate, the entity will get loaded twice.
4. Update the bpel-store's JPA classes. (By adding @Id annotation for Entity, the OpenJPA will add it by default, Hibernate asks it to be declared explicitly.)
5. Run more tests for verifying.

the code can be found at the jpa branch, it is at: http://anonsvn.jboss.org/repos/riftsaw/branches/ODE/ODE-1.x-jpa/

will need to create some sub-tasks for those steps. and then provide patch as each sub-task.

> clean up the JPA module, supports botht openJPA and Hibernate
> -------------------------------------------------------------
>
>                 Key: ODE-704
>                 URL: https://issues.apache.org/jira/browse/ODE-704
>             Project: ODE
>          Issue Type: Improvement
>          Components: BPEL Runtime
>    Affects Versions: 1.3.3
>            Reporter: Jeff Yu
>             Fix For: 2.0
>
>
> see this thread for detail.
> http://mail-archives.apache.org/mod_mbox/ode-dev/200911.mbox/%3C436a94770911160003m682f1678ra9bd9f00fdc49763@mail.gmail.com%3E

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (ODE-704) clean up the JPA module, supports botht openJPA and Hibernate

Posted by "Jeff Yu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ODE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeff Yu resolved ODE-704.
-------------------------

    Resolution: Fixed

This was done in Aaron's patch.

> clean up the JPA module, supports botht openJPA and Hibernate
> -------------------------------------------------------------
>
>                 Key: ODE-704
>                 URL: https://issues.apache.org/jira/browse/ODE-704
>             Project: ODE
>          Issue Type: Improvement
>          Components: BPEL Runtime
>    Affects Versions: 1.3.3
>            Reporter: Jeff Yu
>            Assignee: Jeff Yu
>             Fix For: 2.0
>
>
> see this thread for detail.
> http://mail-archives.apache.org/mod_mbox/ode-dev/200911.mbox/%3C436a94770911160003m682f1678ra9bd9f00fdc49763@mail.gmail.com%3E

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ODE-704) clean up the JPA module, supports botht openJPA and Hibernate

Posted by "Jeff Yu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839604#action_12839604 ] 

Jeff Yu commented on ODE-704:
-----------------------------

Hi Aaron,

As Rafal said, ideally, we should do this, and thats what we will do for this task.
we are very glad that you are interested in it, below are the steps for you to get involved in this task.

1. get an account in github if you don't have, and then I will add you in the ode jpa project. (http://github.com/jeffyu/ode/tree/jpa)
2. working on the tasks that you like, and then commit it into github.

You can find below commit logs (related to this task)  in the project's commit list. (http://github.com/jeffyu/ode/commits/jpa)

update the Buildfile to include the dao-jpa-hibernate and dao-jpa-ojpa 
module 

add dao-jpa-hibernate for hibernate JPA provider. add dao-jpa-ojpa for 
OpenJPA 

pull out the OpenJPA specific API, introducing a JPADaoOperatorFactory 
adding @Id for @Entity, otherwise hibernate will complain about it 

replace the @Column with @JoinColumn 

If you like to refactor the bpel-store module, you can work on https://issues.apache.org/jira/browse/ODE-720 task.

Let me know if you have any other questions with regard to this task.

Regards
Jeff


> clean up the JPA module, supports botht openJPA and Hibernate
> -------------------------------------------------------------
>
>                 Key: ODE-704
>                 URL: https://issues.apache.org/jira/browse/ODE-704
>             Project: ODE
>          Issue Type: Improvement
>          Components: BPEL Runtime
>    Affects Versions: 1.3.3
>            Reporter: Jeff Yu
>             Fix For: 2.0
>
>
> see this thread for detail.
> http://mail-archives.apache.org/mod_mbox/ode-dev/200911.mbox/%3C436a94770911160003m682f1678ra9bd9f00fdc49763@mail.gmail.com%3E

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ODE-704) clean up the JPA module, supports botht openJPA and Hibernate

Posted by "Jeff Yu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12786877#action_12786877 ] 

Jeff Yu commented on ODE-704:
-----------------------------

FYI, this task is working at the github jpa branch. http://github.com/jeffyu/ode/tree/jpa

haven't finished yet, but if you are interested, feel free to look at it and provide comments.

> clean up the JPA module, supports botht openJPA and Hibernate
> -------------------------------------------------------------
>
>                 Key: ODE-704
>                 URL: https://issues.apache.org/jira/browse/ODE-704
>             Project: ODE
>          Issue Type: Improvement
>          Components: BPEL Runtime
>    Affects Versions: 1.3.3
>            Reporter: Jeff Yu
>             Fix For: 2.0
>
>
> see this thread for detail.
> http://mail-archives.apache.org/mod_mbox/ode-dev/200911.mbox/%3C436a94770911160003m682f1678ra9bd9f00fdc49763@mail.gmail.com%3E

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (ODE-704) clean up the JPA module, supports botht openJPA and Hibernate

Posted by "Jeff Yu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839604#action_12839604 ] 

Jeff Yu edited comment on ODE-704 at 3/1/10 8:56 AM:
-----------------------------------------------------

Hi Aaron,

As Rafal said, ideally, we should do this, and thats what we will do for this task.
we are very glad that you are interested in it, below are the steps for you to get involved in this task.

1. get an account in github if you don't have, and then I will add you in the ode jpa project. (http://github.com/jeffyu/ode/tree/jpa)
2. check out the code from github, working on the tasks that you like, and then commit it into github.

You can find below commit logs (related to this task)  in the project's commit list. (http://github.com/jeffyu/ode/commits/jpa)

update the Buildfile to include the dao-jpa-hibernate and dao-jpa-ojpa 
module 

add dao-jpa-hibernate for hibernate JPA provider. add dao-jpa-ojpa for 
OpenJPA 

pull out the OpenJPA specific API, introducing a JPADaoOperatorFactory 
adding @Id for @Entity, otherwise hibernate will complain about it 

replace the @Column with @JoinColumn 

If you like to refactor the bpel-store module, you can work on https://issues.apache.org/jira/browse/ODE-720 task.

Let me know if you have any other questions with regard to this task.

Regards
Jeff


      was (Author: jeff.yu):
    Hi Aaron,

As Rafal said, ideally, we should do this, and thats what we will do for this task.
we are very glad that you are interested in it, below are the steps for you to get involved in this task.

1. get an account in github if you don't have, and then I will add you in the ode jpa project. (http://github.com/jeffyu/ode/tree/jpa)
2. working on the tasks that you like, and then commit it into github.

You can find below commit logs (related to this task)  in the project's commit list. (http://github.com/jeffyu/ode/commits/jpa)

update the Buildfile to include the dao-jpa-hibernate and dao-jpa-ojpa 
module 

add dao-jpa-hibernate for hibernate JPA provider. add dao-jpa-ojpa for 
OpenJPA 

pull out the OpenJPA specific API, introducing a JPADaoOperatorFactory 
adding @Id for @Entity, otherwise hibernate will complain about it 

replace the @Column with @JoinColumn 

If you like to refactor the bpel-store module, you can work on https://issues.apache.org/jira/browse/ODE-720 task.

Let me know if you have any other questions with regard to this task.

Regards
Jeff

  
> clean up the JPA module, supports botht openJPA and Hibernate
> -------------------------------------------------------------
>
>                 Key: ODE-704
>                 URL: https://issues.apache.org/jira/browse/ODE-704
>             Project: ODE
>          Issue Type: Improvement
>          Components: BPEL Runtime
>    Affects Versions: 1.3.3
>            Reporter: Jeff Yu
>             Fix For: 2.0
>
>
> see this thread for detail.
> http://mail-archives.apache.org/mod_mbox/ode-dev/200911.mbox/%3C436a94770911160003m682f1678ra9bd9f00fdc49763@mail.gmail.com%3E

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ODE-704) clean up the JPA module, supports botht openJPA and Hibernate

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12869296#action_12869296 ] 

Hudson commented on ODE-704:
----------------------------

Integrated in ODE-trunk #265 (See [http://hudson.zones.apache.org/hudson/job/ODE-trunk/265/])
    

> clean up the JPA module, supports botht openJPA and Hibernate
> -------------------------------------------------------------
>
>                 Key: ODE-704
>                 URL: https://issues.apache.org/jira/browse/ODE-704
>             Project: ODE
>          Issue Type: Improvement
>          Components: BPEL Runtime
>    Affects Versions: 1.3.3
>            Reporter: Jeff Yu
>            Assignee: Jeff Yu
>             Fix For: 2.0
>
>
> see this thread for detail.
> http://mail-archives.apache.org/mod_mbox/ode-dev/200911.mbox/%3C436a94770911160003m682f1678ra9bd9f00fdc49763@mail.gmail.com%3E

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ODE-704) clean up the JPA module, supports botht openJPA and Hibernate

Posted by "Aaron Anderson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839355#action_12839355 ] 

Aaron Anderson commented on ODE-704:
------------------------------------

I noticed that the bpel-store module has some JPA/Hibernate classes in it. Should those classes also be moved into the dao-hibernate and the new dao-jpa modules? I am interested in working on this issue. Is there anything that I could assist with to help get this code merged into the trunk?  

> clean up the JPA module, supports botht openJPA and Hibernate
> -------------------------------------------------------------
>
>                 Key: ODE-704
>                 URL: https://issues.apache.org/jira/browse/ODE-704
>             Project: ODE
>          Issue Type: Improvement
>          Components: BPEL Runtime
>    Affects Versions: 1.3.3
>            Reporter: Jeff Yu
>             Fix For: 2.0
>
>
> see this thread for detail.
> http://mail-archives.apache.org/mod_mbox/ode-dev/200911.mbox/%3C436a94770911160003m682f1678ra9bd9f00fdc49763@mail.gmail.com%3E

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ODE-704) clean up the JPA module, supports botht openJPA and Hibernate

Posted by "Tammo van Lessen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12784364#action_12784364 ] 

Tammo van Lessen commented on ODE-704:
--------------------------------------

Sounds really cool.

One additional comment (before I forget): The JPA daos do not fully implement all instance management operations (e.g. the full filterset). That's some that need some migration work, too.

> clean up the JPA module, supports botht openJPA and Hibernate
> -------------------------------------------------------------
>
>                 Key: ODE-704
>                 URL: https://issues.apache.org/jira/browse/ODE-704
>             Project: ODE
>          Issue Type: Improvement
>          Components: BPEL Runtime
>    Affects Versions: 1.3.3
>            Reporter: Jeff Yu
>             Fix For: 2.0
>
>
> see this thread for detail.
> http://mail-archives.apache.org/mod_mbox/ode-dev/200911.mbox/%3C436a94770911160003m682f1678ra9bd9f00fdc49763@mail.gmail.com%3E

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ODE-704) clean up the JPA module, supports botht openJPA and Hibernate

Posted by "Aaron Anderson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12840702#action_12840702 ] 

Aaron Anderson commented on ODE-704:
------------------------------------

Hi Jeff,

Thanks for the pointers on helping me get started on this task. I have setup a github project and created a fork of your JPA branch. I have made some progress with separating the JPA and hibernate code apart based on your initial effort and I  also have started to attempt to unify the JPA DAO patterns used in the DAO and bpel-store modules. I had a few questions and I was hoping you could provide me some guidance on them.

1) Maven modules - To prevent module proliferation I was thinking that the DAO, store, and scheduler implementations could be stored in the same module per implementation. For example, 

ode-dao - contains new generic DAO ConnectionFactory interface(s)  and the existing core DAOConnection interfaces
dao-jpa - contains all the JPA entities, including dao, store, and soon to be scheduler. The store and scheduler implementations would still be in different packages and persistence units.
dao-hibernate - contains all the hibernate entities, including dao, store, and soon to be scheduler. Includes factory implementation classes that implement generic interfaces in ode-dao
dao-jpa-ojpa - contains factory implementation classes that implement generic interfaces in ode-dao. The factory primes the JPA environment with the the openjpa specific properties
dao-jpa-hibernate - same as dao-jpa-ojpa but for hibernate
bpel-store - contains factory implementation classes that implement generic interfaces in ode-dao and the existing store connection code.
bpel-scheduler-simple -  the same as bpel-store with new connection based DAO
il-common - OdeConfigProperties updated to include new factory class lookups for the store and scheduler implementations

What do you think of this approach?

2) OpenJPA class enhancements - OpenJPA requires that the classes be annotated in order to be utilized unless a JavaEE container is used or their runtime agent is utilized. The problem is that these class enhancements would interfere with a different JPA implementations and duplicating the entities per implementation module would lead to too much redundancy. To address this I took the approach of extending the dao-jpa maven pom to duplicate the target classes, run the enhancer on the copy, and then run the maven-jar plugin again with a classifer of openjpa so that two versions of the module will be stored in the maven repo. Is this a valid approach?

3) When examining the ode 2.0 source code I found a lot of references to JDBC datasources and transaction managers in the DAO classes. To me the DAO abstraction classes should be storage implementation agnostic. I would like to refactor the connection interfaces to use the same interface and introduce a common DAO strategy.

//new common interface 
public interface DAOConnectionFactory<C> {

  C getConnection();

  <E> void init(OdeConfigProperties p, E envCtx);

  void shutdown();
}

//Module specific  DAO access implementation (dao, store, scheduler, etc)
public interface BpelDAOConnectionFactory extends DAOConnectionFactory<BpelDAOConnection> {

  BpelDAOConnection getConnection();

  
}

//Implementation specific factory that can be instantiated by the module using an OdeConfigProperties lookup 
public class BpelDAOConnectionFactoryJPAImpl  implements BpelDAOConnectionFactory {

  public BpelDAOConnection getConnection() {
   return new BpelDAOConnectionJpaImpl();
  }

  public <JDBCContext>void init(OdeConfigProperties p, JDBCContext envCtx) {
    
  }

  public void shutdown() {
    
  }
  
}

//This is a implementation specific environment context that the runtime the ode is executed in can pass opaquely through the DAO layer into the implementation. 
public class JDBCContext {

   DataSource getDataSource(){}
   TransactionManager getTransactionManager(){}

}


What are your thoughts on this approach?

Regards,

Aaron

> clean up the JPA module, supports botht openJPA and Hibernate
> -------------------------------------------------------------
>
>                 Key: ODE-704
>                 URL: https://issues.apache.org/jira/browse/ODE-704
>             Project: ODE
>          Issue Type: Improvement
>          Components: BPEL Runtime
>    Affects Versions: 1.3.3
>            Reporter: Jeff Yu
>            Assignee: Jeff Yu
>             Fix For: 2.0
>
>
> see this thread for detail.
> http://mail-archives.apache.org/mod_mbox/ode-dev/200911.mbox/%3C436a94770911160003m682f1678ra9bd9f00fdc49763@mail.gmail.com%3E

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ODE-704) clean up the JPA module, supports botht openJPA and Hibernate

Posted by "Rafal Rusin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839367#action_12839367 ] 

Rafal Rusin commented on ODE-704:
---------------------------------

Yes, they should. 
There is also scheduler-simple/src/main/java/org/apache/ode/scheduler/simple/JdbcDelegate.java class, which is plain jdbc implmenetation for scheduler. 
This is very bad idea to have such thing. It should be moved into JPA DAO as well. 

Regards

> clean up the JPA module, supports botht openJPA and Hibernate
> -------------------------------------------------------------
>
>                 Key: ODE-704
>                 URL: https://issues.apache.org/jira/browse/ODE-704
>             Project: ODE
>          Issue Type: Improvement
>          Components: BPEL Runtime
>    Affects Versions: 1.3.3
>            Reporter: Jeff Yu
>             Fix For: 2.0
>
>
> see this thread for detail.
> http://mail-archives.apache.org/mod_mbox/ode-dev/200911.mbox/%3C436a94770911160003m682f1678ra9bd9f00fdc49763@mail.gmail.com%3E

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (ODE-704) clean up the JPA module, supports botht openJPA and Hibernate

Posted by "Jeff Yu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ODE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeff Yu reassigned ODE-704:
---------------------------

    Assignee: Jeff Yu

> clean up the JPA module, supports botht openJPA and Hibernate
> -------------------------------------------------------------
>
>                 Key: ODE-704
>                 URL: https://issues.apache.org/jira/browse/ODE-704
>             Project: ODE
>          Issue Type: Improvement
>          Components: BPEL Runtime
>    Affects Versions: 1.3.3
>            Reporter: Jeff Yu
>            Assignee: Jeff Yu
>             Fix For: 2.0
>
>
> see this thread for detail.
> http://mail-archives.apache.org/mod_mbox/ode-dev/200911.mbox/%3C436a94770911160003m682f1678ra9bd9f00fdc49763@mail.gmail.com%3E

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.