Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Hibernate 3 integration

  1. #11
    Join Date
    Jul 2005
    Posts
    7

    Default

    The problem is my DAO support is coupled to my domain objects. When hibernate loads the entity it does not insert the supporting datamapper and validator. The datamapper/DAO is used when I call entity.insert().

    Not sure I explained that well :shock:

  2. #12
    Join Date
    Aug 2004
    Posts
    1,905

    Default

    In truth, I am not all that familiar with the Hibernate class that you are using.

    Still, if you are sure it is working correctly and double checked everything, then "if it works, it works"

    But I am still not clear why you are

    Code:
     DomainObject entity = (DomainObject) event.getSession().getPersistenceContext().getEntity(
    new EntityKey(
    event.getId(),
    event.getPersister(),
    EntityMode.POJO)
    );
    instead of
    Code:
      DomainObject entity = (DomainObject) event.getEntity();
    Maybe I am missing something

  3. #13
    Join Date
    Oct 2004
    Location
    Herndon, VA, US
    Posts
    648

    Default

    Quote Originally Posted by benholland
    Yes, that documentation is very comprehensive and useful but doesnt really answer my question.

    Essentially what I want to do is call the context to do the injection when hibernate loads the class. Is the only way to do this using hibernate interceptors??
    I came up with this AOP-based alternative approach which I think is more performant and not dependent on any hibernate features:

    http://www.digizenstudio.com/blog/20...omain-objects/
    --Jing Xue

  4. #14
    Join Date
    Jul 2005
    Posts
    7

    Default

    Thanks for the suggestion and it got me thinking. Unfortunately I cant use AOP on this project but shall use the info for a work around. Shall post anything I come up with.

    Thanks,

    Ben

Similar Threads

  1. Hibernate Integration testing problem
    By Ibexx in forum Data
    Replies: 4
    Last Post: Aug 19th, 2011, 01:41 PM
  2. Best practices for Hibernate integration testing
    By Ibexx in forum Architecture
    Replies: 3
    Last Post: Oct 19th, 2005, 01:38 AM
  3. Replies: 2
    Last Post: Sep 14th, 2005, 11:56 PM
  4. Loosing my SecureContext
    By sklakken in forum Security
    Replies: 3
    Last Post: Jul 21st, 2005, 01:44 PM
  5. Replies: 3
    Last Post: Nov 19th, 2004, 07:16 PM

Posting Permissions

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