-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: How to manipulate Hibernate entities directly?
PostPosted: Mon Jan 16, 2006 8:58 am 
Newbie

Joined: Mon Jan 16, 2006 8:41 am
Posts: 6
Hi everybody!

I am currently trying different persistence frameworks. Hibernate seems very mature as well as powerfull.

Nevertheless, i am adopting a model driven approach, and as a result, the persistence layer won't be hand coded but rather generated, so i don't have the same constraints as other hibernate users.

Moreover, a service layer (actually a layer implementing business services) needs to access also the business objects through the persistenc e layer without having access to the business objects java classes at compile time.

Is it possible, using hibernate, to access persisted entities not using the real java class but using an API such as:

myEntity.load("Product", productID);
myEntity.getAttribute("Description");
myEntity.setAttribute("Price",15.76);

Many thanks for your ideas and help !

Best Regards,

/Jean-Baptiste


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 16, 2006 9:22 am 
Regular
Regular

Joined: Wed Feb 02, 2005 6:33 am
Posts: 70
I think you might be interested in the other entity modes in Hibernate 3, which include DOM and HashMap representations. So, rather than:

Code:
class MyEntity {
    String description;
}


You could have a dom tree like:

Code:
<element name="MyEntity">
    <element name="description"></element>
</element>


Or HashMap like:

Code:
HashMap MyEntity = new HashMap();
MyEntity.put("description", "value");


More info In The Reference Documentation


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 16, 2006 9:30 am 
Newbie

Joined: Mon Jan 16, 2006 8:41 am
Posts: 6
CollinL wrote:
I think you might be interested in the other entity modes in Hibernate 3, which include DOM and HashMap representations.

More info In The Reference Documentation


Thanks a lot, it is definitely what i am looking for!

However, from the documentation, this feature is reported to be "experimental", does this mean that it won't be further developped? or is it "just" the first version?

Cheers,

/JBG


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 16, 2006 9:46 am 
Regular
Regular

Joined: Wed Feb 02, 2005 6:33 am
Posts: 70
I think the hibernate team mean that it's a new feature, introduced in Hibernate 3, so they're not sure that the API is going to be the same, or that enough people are using it for it to be as bug-free as the rest of the code. I'm sure one of the actual team will have said something about this in some other post, so a quick forum search might net you some examples and more details,


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.