EJB3 with hand-coded ORM in JDBC

Discussion in 'Java' started by anondude123@gmail.com, Jun 15, 2007.

  1. Guest

    Hi all,
    I am writing a Stateless session bean in with an EJB 3.0 container
    (using JBoss 4.2 right now, and possibly Glassfish later). This bean
    is going to provide reading/writing from the DB supplemented by some
    business logic (using hand-written JDBC DAO's for my objects). The
    EJB3 annotations for everything non-persistence are great and they
    work for me. However, my underlying data model is more like a EAV (key-
    value pair-ish) type of stuff which does not at all fit into the
    object-relational mapping provided by the EntityManager. So, my
    question is this, is it possibly for me to use EJB3 (so I get all the
    non-persistence annotations), but hand-code my own persistence. I know
    I can just open a JDBC connection myself from the method on the bean,
    but I'd still need to have the txns be container managed. Sorta like
    pre-EJB3 for persistence, but EJB3 for everything non-persistence.
    The problem is that every book/manual/article I've read on EJB 3.0 so
    far uses the persistence annotations and they use hibernate (or some
    other abstraction layer). I just need to be able do my own with JDBC.
    Please please tell me it's possible.
    Any help would be greatly appreciated.
    Thanks,

    Clive
    , Jun 15, 2007
    #1
    1. Advertising

  2. Lew Guest

    wrote:
    > Hi all,
    > I am writing a Stateless session bean in with an EJB 3.0 container
    > (using JBoss 4.2 right now, and possibly Glassfish later). This bean
    > is going to provide reading/writing from the DB supplemented by some
    > business logic (using hand-written JDBC DAO's for my objects). The
    > EJB3 annotations for everything non-persistence are great and they
    > work for me. However, my underlying data model is more like a EAV (key-
    > value pair-ish) type of stuff which does not at all fit into the
    > object-relational mapping provided by the EntityManager. So, my
    > question is this, is it possibly for me to use EJB3 (so I get all the
    > non-persistence annotations), but hand-code my own persistence. I know
    > I can just open a JDBC connection myself from the method on the bean,
    > but I'd still need to have the txns be container managed. Sorta like
    > pre-EJB3 for persistence, but EJB3 for everything non-persistence.
    > The problem is that every book/manual/article I've read on EJB 3.0 so
    > far uses the persistence annotations and they use hibernate (or some
    > other abstraction layer). I just need to be able do my own with JDBC.
    > Please please tell me it's possible.
    > Any help would be greatly appreciated.
    > Thanks,


    Please do not multi-post. I have consolidated the multi-posts that I found so
    that respondents can follow an unfragmented thread.

    --
    Lew
    Lew, Jun 15, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ikarus
    Replies:
    11
    Views:
    1,826
    Jerry Coffin
    Sep 16, 2008
  2. carmelo

    ORM or JDBC?

    carmelo, Mar 23, 2011, in forum: Java
    Replies:
    94
    Views:
    2,242
  3. Alessio Stalla

    Re: ORM or JDBC?

    Alessio Stalla, Mar 23, 2011, in forum: Java
    Replies:
    5
    Views:
    254
    Tom Anderson
    Mar 24, 2011
  4. Alessio Stalla

    Re: ORM or JDBC?

    Alessio Stalla, Mar 24, 2011, in forum: Java
    Replies:
    20
    Views:
    593
    Lawrence D'Oliveiro
    Mar 27, 2011
  5. Alessio Stalla

    Re: ORM or JDBC?

    Alessio Stalla, Mar 25, 2011, in forum: Java
    Replies:
    3
    Views:
    227
Loading...

Share This Page