-->
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.  [ 2 posts ] 
Author Message
 Post subject: Cann't map a synonymy?
PostPosted: Wed Jun 29, 2005 9:00 pm 
Newbie

Joined: Tue Jun 28, 2005 3:57 am
Posts: 2
I have 2 oracle db,A's version is oracle817,B's version is oracle92,i made a synonymy in db 'A' point to a table in db 'B',the table as follow:
SERIAL (
CLS_USER_NO VARCHAR2(11),
CLS_LX_SERIAL_NO VARCHAR2(19) PRIMARY KEY,
CLS_PROCESS_TYPE VARCHAR2(1),
CLS_USER_NAME VARCHAR2(60),
CLS_ADDRESS VARCHAR2(60),
CLS_ZIP VARCHAR2(6),
CLS_PMD VARCHAR2(1),
CLS_BANK_ACCOUNT VARCHAR2(20),
CLS_OPEN_DATE VARCHAR2(10),
CLS_INSERT_DATE VARCHAR2(10),
CLS_97_USER_ID VARCHAR2(8),
CLS_97_SERIAL VARCHAR2(17),
CLS_DO_STATUS VARCHAR2(1),
CLS_DO_DATE VARCHAR2(10),
CLS_SERR VARCHAR2(100)
) ;


and i write the mapping file like this:

<?xml version="1.0"?>

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>
<class
name="com.idealbiz.model.Serial"
table="SERIAL"
dynamic-update="true"
dynamic-insert="true"
>
<id
name="serialNo"
column="CLS_LX_SERIAL_NO"
type="java.lang.Long"
>
<generator class="sequence">
<param name="sequence">Serialcc_seq</param>
</generator>
</id>
<property
name="address"
type="java.lang.String"
update="true"
insert="true"
access="property"
>
<column
name="CLS_ADDRESS"
sql-type="VARCHAR2(60)"
/>
</property>
<property
name="bankAccount"
type="java.lang.String"
update="true"
insert="true"
access="property"
>
<column
name="CLS_BANK_ACCOUNT"
sql-type="VARCHAR2(20)"
/>
</property>
<property
name="doDate"
type="java.lang.String"
update="true"
insert="true"
access="property"
>
<column
name="CLS_DO_DATE"
sql-type="VARCHAR2(10)"
/>
</property>
<property
name="doStatus"
type="java.lang.Character"
update="true"
insert="true"
access="property"
>
<column
name="CLS_DO_STATUS"
sql-type="VARCHAR2(1)"
/>
</property>
<property
name="insertDate"
type="java.lang.String"
update="true"
insert="true"
access="property"
>
<column
name="CLS_INSERT_DATE"
sql-type="VARCHAR2(10)"
/>
</property>
<property
name="openDate"
type="java.lang.String"
update="true"
insert="true"
access="property"
>
<column
name="CLS_OPEN_DATE"
sql-type="VARCHAR2(10)"
/>
</property>
<property
name="pmd"
type="java.lang.Character"
update="true"
insert="true"
access="property"
>
<column
name="CLS_PMD"
sql-type="VARCHAR2(1)"
/>
</property>
<property
name="postcode"
type="java.lang.String"
update="true"
insert="true"
access="property"
>
<column
name="CLS_ZIP"
sql-type="VARCHAR2(6)"
/>
</property>
<property
name="processType"
type="java.lang.Character"
update="true"
insert="true"
access="property"
>
<column
name="CLS_PROCESS_TYPE"
sql-type="VARCHAR2(1)"
/>
</property>
<property
name="serial97"
type="java.lang.String"
update="true"
insert="true"
access="property"
>
<column
name="CLS_97_SERIAL"
sql-type="VARCHAR2(17)"
/>
</property>
<property
name="serr"
type="java.lang.String"
update="true"
insert="true"
access="property"
>
<column
name="CLS_SERR"
sql-type="VARCHAR2(100)"
/>
</property>

<property
name="userId97"
type="java.lang.String"
update="true"
insert="true"
access="property"
>
<column
name="CLS_97_USER_ID"
sql-type="VARCHAR2(8)"
/>
</property>
<property
name="userName"
type="java.lang.String"
update="true"
insert="true"
access="property"
>
<column
name="CLS_USER_NAME"
sql-type="VARCHAR2(60)"
/>
</property>
<property
name="userNo"
type="java.lang.String"
update="true"
insert="true"
access="property"
>
<column
name="CLS_USER_NO"
sql-type="VARCHAR2(11)"
/>
</property>
<bag
name="prods"
lazy="true"
inverse="true"
cascade="all"
>
<key
column="CLP_LX_SERIAL_NO"
>
</key>

<one-to-many
class="com.idealbiz.model.ProductCC"
/>
</bag>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-SerialCC.xml
containing the additional properties and place it in your merge dir.
-->

</class>

</hibernate-mapping>


but when i'm executing an operation of insert ,occured an error like this:

ORA-02063: preceding line from ...
org.springframework.jdbc.UncategorizedSQLException: (HibernateTemplate): encountered SQLException [ORA-01461: can bind a LONG value only for insert
into a LONG column



why?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 29, 2005 9:20 pm 
Newbie

Joined: Tue Jun 28, 2005 3:57 am
Posts: 2
the synonymy is useable,and no column's value more than 4K


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