Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Java EE 7 Tutorial Volume 1 or Volume 2
this week in the
jQuery UI in Action
Object Relational Mapping
Hibernate save Oracle Number
Joined: May 28, 2008
Nov 02, 2011 01:05:49
I am having issues with Hibernate save. I wanted the newly created primary key so I had saved the object but it gives me a class cast exception. Persist works just fine.
Employee e = sessionFactory.getCurrentSession().save does not work
incompatible with com.test.Employee
incompatible with com.test.Employee -- If I change it to
Oracle column - "ID" NUMBER(36 , 0) NOT NULL
@GeneratedValue(generator = "testKey")
@SequenceGenerator(name = "testKey", sequenceName = "ID_SEQ")
@Column(name = "ID")
private Long id;
Should I be using something other than Long
I agree. Here's the link:
subject: Hibernate save Oracle Number
Sequence generation issue
Hibernate_listing database values
Hibernate: using oracle sequence
Weblogic 10.3.1 + Oracle 10g : Invalid Username / Password on LOB inserts!
Setting SYSDATE for insert/update
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014