-->
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: execution of self-defined SQL/HQL query for inserting data
PostPosted: Tue Aug 16, 2005 8:50 am 
Newbie

Joined: Mon Aug 15, 2005 8:03 am
Posts: 14
Location: Germany
Hi,

how can I execute a self-defined SQL/HQL query for inserting data into tables.

The classes HibernateTemplate and Session privides methods for retrieving and saving objects.

Saving objects inserts data into the table defined in htm file. I want to have a "conditional insert". It means, depends on the value of an attribute I wanna write object in table T1 or T2.

Is it possible? I couldn't find any way to execute self-defined SQL/HQL.

Thanks in advance,
Reza


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 16, 2005 10:38 am 
Regular
Regular

Joined: Thu May 26, 2005 2:08 pm
Posts: 99
Why can't the conditional be handled in your Java code?

Perhaps supplying the requested information would help people help you.

Quote:
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:



Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 3:30 am 
Newbie

Joined: Mon Aug 15, 2005 8:03 am
Posts: 14
Location: Germany
Hi jdl, hello all,

following scenario:
I'm using hibernate 3.0 . My object Inst has an attribute type. Depends on the value of this attribute, instances of Inst should be mapped on different tables. For evaluating we are using mySQL, target platform is Oracle.

I wanna do the dispatching (deciding, which table should be taken for an instance) by configuration, if possible.

Reza


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.