-->
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.  [ 5 posts ] 
Author Message
 Post subject: Simple insert into with Hibernate?
PostPosted: Tue May 22, 2007 5:45 am 
Newbie

Joined: Tue May 22, 2007 5:39 am
Posts: 1
I have a external file of SQL insert into rows.
Is there a class in Hibernate API that I could use to "run" these SQL rows into the database... by not using any hbm-files etc. Just pure SQL.

I know that this could be done in number of ways but this time it should be done with Hibernate tools.

An working example would be great :)


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 22, 2007 9:21 am 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
session.getConnection();

run them yourself

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 22, 2007 9:27 am 
Newbie

Joined: Tue May 22, 2007 9:19 am
Posts: 4
hey man, i need to execute a store procedure from SQL Server 2000 in HIbernate, do you help me???


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 22, 2007 9:34 am 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
http://www.hibernate.org/hib_docs/v3/re ... l#sp_query

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 22, 2007 9:37 am 
Newbie

Joined: Tue May 22, 2007 9:19 am
Posts: 4
hi mna, thx

but...
where put this code??
where put de mapping of the sql-query property?
<sql-query name="selectAllEmployees_SP" callable="true">
<return alias="emp" class="Employment">
<return-property name="employee" column="EMPLOYEE"/>
<return-property name="employer" column="EMPLOYER"/>
<return-property name="startDate" column="STARTDATE"/>
<return-property name="endDate" column="ENDDATE"/>
<return-property name="regionCode" column="REGIONCODE"/>
<return-property name="id" column="EID"/>
<return-property name="salary">
<return-column name="VALUE"/>
<return-column name="CURRENCY"/>
</return-property>
</return>
{ ? = call selectAllEmployments() }
</sql-query>


thanks again[/i]


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