Results 1 to 3 of 3

Thread: CMP and Spring

  1. #1
    Join Date
    Nov 2004
    Posts
    18

    Default CMP and Spring

    Hi,

    I've been trying for a few days to get Hibernate to work with a legacy schema (see http://forum.hibernate.org/viewtopic.php?t=936357 for example). I can't seem to make Hibernate like my schema so I'm beguinning to think that it may not be the right technology to use.

    IO'm now looking at other options, one being JDO and the other being EJB. My database schema contains a lot of composite keys which act as primary keys and as foreign keys.

    The application that used to manage this model did all the relationship management in the application. We now have data integrity issues and other problems associated with this. I'm in the process of re-implementing part of the application to Java. I'm not allowed to change the database model, so I'm stuck with the composite keys.

    I'm trying very hard to make sure that whatever persistence technology I use does the relationship management for me. I tried Hibernate, but my experience so far is that it has a lot of trouble with bad schema designs (like mine).

    I took a look around at EJB 2.x and JDO. JDO doesn't seem to support foreign composite keys. It's a vendor-specific feature. It looks like I may be able to this using entity beans. I'd like to avoid coding SQL commands in my code as much as possible and let the container (or something else) do it.

    So all of this to ask: how can I use entity beans with Spring? Every time someone asks this question, the standard answer seems to be "Don't use EJB's, use Hibernate!" Well, I tried and I'm not getting anywhere. :-(

    Thanks,

    L[/i]

  2. #2
    Join Date
    Aug 2004
    Location
    Montréal, Canada
    Posts
    845

    Default

    well, I am not trying to answer your how EJB question, but, did you consider using http://www.ibatis.com for your database access layer? iBatis is very flexible and does not requires a highly normalized database model. Also, Spring has excellent support for iBatis including easy configuration, DAO Template and declarative transaction demarcation.
    For more information, you may review jpetstore sample from Spring distribution.
    HTH
    Omar Irbouh

    Spring Modules Team
    http://irbouh.blogspot.com/

  3. #3
    Join Date
    Nov 2004
    Posts
    18

    Default

    No, I never thought of using iBatis. Let me see whati can do with it.

    Thanks,

    L

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •