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?
|