Nishita Jain

Ranch Hand
+ Follow
since Mar 30, 2006
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nishita Jain

Good question. Even i want to know that why its not working. i tried with String class. for that its working but for ArrayList its not:(
I think I am not getting your point.
db wil create pk den save the obj .If i try to load the same obj using other properties der me multiple objects .
so point is how to get that generated Id.
THnaks for your reply.
you are saying to get the generated id from the parent table . but the problem is that pk id in parent table is generated by db not by hibernate. SO i am not able to load the parent object. For loading it i need id but id is not there in hibernate session.
Thanks for your reply.
I know that heavy weight operation. I just want to know that if I call

SessionFactory sessionFactory = new Configuration().configure().buildSessionfactory();
n number of times in our project wil it retun same object? if answer is yes then how?


I want to know that if we call
SessionFactory sessionFactory = new Configuration().configure().buildSessionfactory();
n number of times in our project wil it retun same object? if yes then how?
I know that SessionFactory objects are immutable and object is return based on the given config params.

Multipart multipart = new MimeMultipart();
MimeBodyPart messageBodyPart = new MimeBodyPart();


messageBodyPart = new MimeBodyPart();

String fileAttachment = "D:\\timer.txt";
DataSource source = new FileDataSource(fileAttachment);
messageBodyPart.setDataHandler( new DataHandler(source));

//second attachment
MimeBodyPart messageBodyPart2 = new MimeBodyPart();
DataSource source2 = new FileDataSource("D:\\searchQuery.txt");
messageBodyPart2.setDataHandler( new DataHandler(source2));
. . .


Hope this is helpful:)

13 years ago
In one of my tables, the composite key is consist of one auto increment key and one foreign key; this composite key is used as foreign key in some tables.
In the hibernate mapping, <composite-id> doesn’t allow <generator>, so i enabled the auto increment property for ID filed at data base level.

Because of this scenario, the records are getting inserted in parent as well as child table but the ID which is auto increment key is not getting inserted in child table where as it has been generated by database for respective record.

In tb1 table, the composite key is consist of ,

ID - an auto increment key (at database level)

fk_ID - a foreign key

This composite key is used as a foreign key in tb2 and other table as well.

So when trying to insert the record, the ID has been generated and records are getting inserted in both the tables tb1 and tb2. but the value for ID in tb2 is null.

Can anybody tell me the solution?
one of the solutions for this problem, is using CompositeUserType for composite id class and then defining a custom IdentifierGenerator that populates the generated value into the composite key class.
But is there any other way?


hi all,
Thanks for reply. i got the idea now:)
Thanks for reply.
I am asking about any possible kind of distributed environment like in distributed servers. can you give me more detail about it.
Is hibernate restricted to any kind of environment?
Also tell me in which environment hibernate is not useful.(e.g where tables are very less and too many store proc are present).

I just wanted to know is Hibernate suitable for distributed environment? or any link which can give me better idea about it.

I am new to Drools and i want to know how can i perform validation using drl file.
I mean i want to validate data like if given number is float or integer.
i know drool is made to implement business logic.. but before applying that logic i need to validate data in drl file.

13 years ago
Hey thank you very much ..
I was not knowing about lazy-init feature in spring..
I am clear now
Thanks again.
I have one doubt. I always read about the spring ,that it creates object whenever required. but what i found that it created the objects whenever application starts.All the objects are created at that time only.
So that means object are created at application startup and injected whenevr required.
So i m confused abt this,Pl tell me why they have written like

creates object whenever required


Thank you
Hi ,
I want to know that why should we use struts 2.x over struts1.x
I know what is the difference between these two but from that i couldn't found why we should use struts2.x
I felt that 2.x is bit hard to understand and interceptor concerns are very high in it.I feel it is more complex.

So pl help me out
14 years ago