Bhavik Patel

Ranch Hand
+ Follow
since Jul 12, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Bhavik Patel

Hi ,

I have one to may relationship on my obejct model.
one summary can have many details. I have inverse =true set on details.so this association is owned by detail class. Now my question is, i have already eagerly loaded summaries( with details fetched). Is it ok to only save summaries and not details because details are not updated?? I am afraid becuase of the inverse=true on details.

inverse=true falg decides which end should manage the association. if Item class is managing the association then it should make sure that association with child is updated when we modify the Item
Upgrade mode works for Select for Update.Which means we select the data with some query and we can lock that for the following update.

My question is how long the records are being locked.. If i update some of the objects then other records will still stay locked.

I will be updating only certain records not all of the records based on the business rules.

My concern is tha will the not udpated records stay locked all of the time or how long ??
I am using the following query to load the items



Now when i will try to update and save summary objects retrieved from above query with the following call
saveOrUpdate(summary)

will that also save and update details in side it or only summary objects??
Thanks..

Is there a way to maintain relationship with the tables..

Lets say Employee and Department table are linked with dept id .. Is it possible to detect the foreign key from the metadata and indicate flag in front end on the table's column to indicate that this column is foreign key so make sure for dependency with the parent table?? any thoughts..
Hii,

I am planning to create a database utility tool that can allow us to maintain the static data let's say user information , staff details and something like that..

My initial thought was to create a generic web screen that can load the data based on the table name entered and from there allowing to maintian the data ..means insert or update..

Now challenge is it should be generic enough to apply for all static tables..

It should also handle relationship between the tables if any ...

What should be the appropriate approach in this case..
Hii ,

I was wondering how can i create a parent dropdown and child text box such that selecting value from parent will change the value in the text field ( text field is read only ) ..

so lets say i have a dropdown with Department codes then if i change the department code its description ( one text box) and dept head name( another text box) populates automatically ,....

I can do this with AJAX also but how do i do this with custom tags..make sure that my parent tag should also have behaviour of dropdown and child tag should have behaviour of text box..

Waiting for the reply..

Bhavik
12 years ago
JSP
so i can write something like

from ProductGroup as pg left fetch join pg.products

but Does the above query will give me unique results..I mean no duplicates after join ...??
In my mapping i have one named query defined as

from productGroup order by name

producGroup has many products ...<set name="products" ...>

so running the above queries it also tries to load all the products..That is ok with me but i want it to be loaded in singel query instead of individual select statements ... How do i wrote the above query so it also load all products while loading the product group instead of running n times select for each product whicle referring the collection products.

thanks
I have one master table lets say staff with staffID and 6 other tables are using the staffID along with their data.. Does that mean that my staff table mapping will have <set> ( assuming theres one to many relation ) element for all 6 tables ...How do i decide whether it hsould be bi directional asociation or uni direction association and what i have to do in mappings to ensure its implementing association properly .. please give me an example to clear this doubt as i am new to hibernate and this associations confuse me a lot...

Thanks
can any one give me some good article about defining the relationship - associations for the classes/mappings. Does the Assciations make difference while loading up the whole object graph .. How to distinguish whether uni directional association is needed or Bi directional ??
Thanks James & pai .. I will try that and will let you know if i have any issues( I am sure i will have )
It uses HibernateDAOTemplate to handle the session..Hibernate runs lot of sql statements in the beginning and traverses the whole object graph ( parent -child ) and retrieves all of the objects.. My problem is that i tried to make it lazy ..tried to set up the batch size but all things ended with exceptions ...if i make all mappings lazy then i am getting Session Closed exception ..I am seeing the call in web service at this point..and it looks like some thing is triggered outside the context..for the batch size setting .. I am getting XYZ object not found at runtime...My question is what should i do to improve the performance and what guidelines i should follow ..I don't know much about Hibernate -Spring
I am new to hibernate and wanted to know how do i represent one to many association in mapping file if i just want it to be unidirectional.

if i represent < one-to-many > element in one class and <many-one> in other class then does it mean it's representing Bi directional Association ??