-->
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: dynamic models & hibernate 5
PostPosted: Wed Nov 30, 2016 6:05 am 
Newbie

Joined: Wed Nov 30, 2016 5:31 am
Posts: 2
Hi,
Dynamic models seem to be fully integrated to hibernate 5, not in beta now :)
Hibernate 5 documentation (http://docs.jboss.org/hibernate/stable/core/userguide/html_single/Hibernate_User_Guide.html#dynamic-model) mention a main update :
Quote:
A given entity has just one entity mode within a given SessionFactory. This is a change from previous versions which allowed to define multiple entity modes for an entity and to select which to load. Entity modes can now be mixed within a domain model; a dynamic entity might reference a POJO entity, and vice versa.


So : Entity A is handle by POJO mode and Entity B by MAP mode in the current Session.

My goal is to have Entity A mapped with annotation, in POJO Mod, and Entity B with hbm file in MAP mode (or better mapped at runtime by code), and to define a one2one relation between this 2 entities. I need to access Entity B from Entity A with classic getter.

I'm looking for advanced documentation & exemple about Dynamics Models in Hibernate 5 (i didn't found any) and the use of this new behaviour. Have ever used it ? Advice, Feedback ?

Thanks


Top
 Profile  
 
 Post subject: Re: dynamic models & hibernate 5
PostPosted: Wed Nov 30, 2016 6:18 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
This hasn't been documented because it's very narrow use case. You can create an issue on Jira, but there are many more issues waiting to be fixed, so this one will not have a high priority.

However, if you provide a Pull Request with an update to our documentation (we are using AsciiDoctor and inject code snippets from Unit Test - so it's super Hipsterish and cool!), then I'll integrate your change right away.


Top
 Profile  
 
 Post subject: Re: dynamic models & hibernate 5
PostPosted: Wed Nov 30, 2016 6:25 am 
Newbie

Joined: Wed Nov 30, 2016 5:31 am
Posts: 2
Ok, thanks for your answer ! I will look for creating a JIRA issu for the doc.

Do you know if this behavior is only possible ?
Quote:
My goal is to have Entity A mapped with annotation, in POJO Mod, and Entity B with hbm file in MAP mode (or better mapped at runtime by code), and to define a one2one relation between this 2 entities. I need to access Entity B from Entity A with classic getter.


Top
 Profile  
 
 Post subject: Re: dynamic models & hibernate 5
PostPosted: Wed Nov 30, 2016 7:08 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
I have no idea since I've never tried it. We have tests that use either Pojo or dynamic-map, but I haven't seen any use case where these two get mixed. That's why I can't tell what will happen.


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.