-->
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.  [ 3 posts ] 
Author Message
 Post subject: Any Issues with not using O/R Mappings?
PostPosted: Tue Nov 06, 2007 9:24 pm 
Newbie

Joined: Tue Nov 06, 2007 9:09 pm
Posts: 2
We have decided to not use O/R mappings for our application (i.e. OneToMany, OneToOne, ManyToOne, ManyToMany). Instead, we will just use the primary keys in our pojo's (i.e. accoundId instead of account). For any fetching, we will perform a regular SELECT statement. Also, we will manually create the database foreign key constraints.

I don't want to go into the details of the "why" but here are some:
1) MOST of our pojos will be lazy loaded hence we won't have much of a performance pick up from EAGER loading (left joins).

2) We have to serialize our pojo's which causes the infamous LazyInitializationException since serialization occurs outside of our session. We don't want to start a session or clone the object to resolve this issue.

3) Our UI layer is more geared to using pojo id's than the objects themselves.

Question:

Since we have eliminated the use of O/R mappings from our application, will we run into ANY serious hibernate issues?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 07, 2007 2:24 pm 
Newbie

Joined: Thu Oct 25, 2007 3:37 pm
Posts: 17
seems like you will lose all of the cascading updates, etc.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 07, 2007 8:41 pm 
Newbie

Joined: Tue Nov 06, 2007 9:09 pm
Posts: 2
Yes, I should have mentioned we won't be using the cascading options either. Really, we are using hibernate for its built in pooling and db abstraction. We won't be using many of its other features.

I've been digging through documents and testing code and we ran into one problem so far. When you create a hql query that has a LEFT join, you cannot use the syntax "LEFT JOIN Investor i ON i.pid=ip.investor_pid". LEFT JOIN's don't give you the ON option. It seems like we will have to use native queries for sql's that have left joins.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.