Friends,
I'm new to Hibernate.
When I try to insert a row in the table - I get 'inserted value too large for the column' -
Here's my mapping
hibernate-mapping>
<class name="com.omx.common.resource.hibernate.beans.CompanyList" table="company_list">
<id name="companyID" column="COMPANY_ID" type="long" unsaved-value="null">
<generator class="sequence">
<param name="sequence">COMPANY_SEQ</param>
</generator>
</id>
<property name="companyName" column="COMPANY_NAME" type="string" not-null="true"/>
<property name="companyState" column="COMPANY_STATE" type="string" not-null="true"/>
<property name="lastModBy" column="LAST_MOD_BY" type="string"/>
<property name="lastModDate" column="LAST_MOD_DATE" type="date" not-null="true"/>
and here's my java code
Session session = HibernateSession.currentSession();
Transaction tx = session.beginTransaction();
CompanyList c = new CompanyList();
//c.setCompanyID(new Long(222222));
c.setLastModBy("RAM");
c.setLastModDate(new java.util.Date());
c.setCompanyName("RAMS");
c.setCompanyState("IL");
c.setOriginator("RAM");
c.setCreationDate(new java.util.Date());
session.save(c);
tx.commit();
session.close();
I tried to set the primary key from my application and it didn't work. so I commented that out.
Thanks for your time.
Ram
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: