-->
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.  [ 4 posts ] 
Author Message
 Post subject: Could not format discriminator value to SQL string ?????
PostPosted: Tue Apr 20, 2004 6:07 pm 
Beginner
Beginner

Joined: Tue Apr 06, 2004 6:13 pm
Posts: 39
Location: Pune, Maharashtra, INDIA
Hi,

My Hydrated class has an attribute of a custom type

I have declared it as a Hibernate discriminator.

But I find the discriminator has to be set as 'String'
I want as integer but with that when Hibernate initializes it gives error
Could not format discriminator value to SQL string

Any clues ?

My Hibernate mapping (partial) is as
Code:

<hibernate-mapping>
   <class name="equicom.offline.transmission_profile.TransmissionProfile" table="TRANSMISSION_PROFILE" dynamic-update="false" dynamic-insert="false">
      <id name="profileID" column="PROFILE_ID" type="integer">
         <generator class="native"></generator>
      </id>

      <discriminator column="PURPOSE" type="integer" />

      <property name="description" type="string" update="true" insert="true" column="DESCRIPTION" not-null="false" unique="false" />

      <property name="purpose" type="equicom.offline.transmission_profile.TransmissionPurpose" update="false" insert="false" column="PURPOSE" />


I am using Hibernate 2.1, with Oracle

_________________
thks
G1


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 20, 2004 7:31 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Specify discriminator-value for your class and all its mapped subclasses.


Top
 Profile  
 
 Post subject: why the base class
PostPosted: Wed Nov 30, 2005 1:40 pm 
Newbie

Joined: Thu Nov 17, 2005 1:29 pm
Posts: 12
michael wrote:
Specify discriminator-value for your class and all its mapped subclasses.


Why is it necessary for the base class to set a discriminator if it will never be applied?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 30, 2005 3:34 pm 
Regular
Regular

Joined: Tue Oct 28, 2003 8:25 am
Posts: 72
Location: Belgium
It is a limitation of Hibernate 2.x that has been addressed in 3.x.

See http://www.hibernate.org/hib_docs/v3/re ... criminator


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