-->
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.  [ 6 posts ] 
Author Message
 Post subject: Configuring how sql calls are made to the database
PostPosted: Tue Sep 23, 2003 3:24 pm 
Beginner
Beginner

Joined: Wed Sep 17, 2003 10:25 am
Posts: 36
Hi,

I am trying to deal with inserting/reading international text into ms sqlserver2000. MS documentation specifies that I will need to add the letter 'N' before any value inserted/read from the database in Unicode. is there a way to specify that this happen in the hibernate mapping file? I have been looking at the formula property for the property tag. How is that tag used? Has anyone done this before?

Thanks...


Top
 Profile  
 
 Post subject: okay...
PostPosted: Tue Sep 23, 2003 8:23 pm 
Beginner
Beginner

Joined: Wed Sep 17, 2003 10:25 am
Posts: 36
I will reword my question I guess. How does one use teh "formula" property in the property element in class? The documentation was not so clear on what it can be used for.

Thanks...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 24, 2003 4:52 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
The formula attribute on the property tag allows you to define a sql expression that is used to create a value which is virtual/computed. For example, one real property might be the count value of female children and another count value of male children so you can then have a computed value that is the total number of children, eg, the sum of the two real fields.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 24, 2003 9:57 am 
Regular
Regular

Joined: Tue Aug 26, 2003 3:09 pm
Posts: 58
I believe this is usually taken care of by the driver (atleast that appears to be the case with my setup). I am using the jTDS driver, and it seems to be doing this for me automatically. I don't see it in the hibernate logging because (I assume) the driver is converting it internally. I just ran SQL Server Profiler to see what was actually being sent to the database.

Joe


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 24, 2003 12:27 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Type conversion form the SQL database type to the Java type is JDBC action so yes you are correct but unless I miss-understood the question, it was refering to a property option that allows a property to be set that does not (necessarily) exist as a field in the database, eg, use multiple fields to calculate something. This allows the data to be set at record creation time (hence db does processing) rather then you including Java code to do the calculation (hence middletier server processing).


Top
 Profile  
 
 Post subject: Thanks...
PostPosted: Fri Sep 26, 2003 2:54 am 
Beginner
Beginner

Joined: Wed Sep 17, 2003 10:25 am
Posts: 36
Thanks for your replies. David, thanks for the information and examples on the formula attribute. I will give it a spin. jfifield, thanks for the reply. I will look into the profile to the database and see what it sends in. That is exactly what I am looking for to see what is moving in and out of my db.

Peace...


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