-->
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.  [ 1 post ] 
Author Message
 Post subject: yes_no property being mapped to "true"/"false
PostPosted: Wed Mar 21, 2007 2:24 pm 
Newbie

Joined: Mon Oct 23, 2006 11:03 pm
Posts: 17
From the log:

Hibernate:
/* insert collection
row com.wholefoods.ittoolkit.ws.ccf.Request.assets */ insert
into
ITTOOLKIT.CR_ASSET
(REQ_ID, ASSET_ENTRY_ID, NAGIOS_DOWNTIME, REBOOT, SYSTEM_TYPE_ID, OS_TYPE_ID)
values
(?, ?, ?, ?, ?, ?)
12:15:26,546 DEBUG org.hibernate.jdbc.AbstractBatcher:476 - preparing statement
12:15:26,562 DEBUG org.hibernate.type.LongType:133 - binding '41' to parameter: 1
12:15:26,562 DEBUG org.hibernate.type.StringType:126 - binding null to parameter: 2
12:15:26,562 DEBUG org.hibernate.type.YesNoType:133 - binding 'true' to parameter: 3
12:15:26,577 DEBUG org.hibernate.type.YesNoType:133 - binding 'false' to parameter: 4
12:15:26,577 DEBUG org.hibernate.engine.IdentifierValue:77 - id unsaved-value strategy UNDEFINED
12:15:26,577 DEBUG org.hibernate.type.StringType:133 - binding 'PRD' to parameter: 5
12:15:26,577 DEBUG org.hibernate.engine.IdentifierValue:77 - id unsaved-value strategy UNDEFINED
12:15:26,577 DEBUG org.hibernate.type.StringType:133 - binding 'Windows' to parameter: 6

The database column is defined as CHAR(1), so of course binding 'true' or
'false' fails with "value too large". Everything I can find on the web and
in JPE about type="yes_no" indicates it will be mapped as "Y" and "N",
not "true" and "false". Is this a bug?

Here's the corresponding mapping:

<bag name="assets" table="CR_ASSET">
<key column="REQ_ID" />
<composite-element class="Asset">
<property name="assetEntryId" column="ASSET_ENTRY_ID" />
<property name="nagiosDowntime" column="NAGIOS_DOWNTIME" type="yes_no" />
<property name="reboot" column="REBOOT" type="yes_no" />
<many-to-one name="systemType" column="SYSTEM_TYPE_ID" fetch="join"
class="com.wholefoods.ittoolkit.ws.code.SystemType"/>
<many-to-one name="osType" column="OS_TYPE_ID" fetch="join"
class="com.wholefoods.ittoolkit.ws.code.OsType"/>
</composite-element>
</bag>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.