Hibernate configuration issue with DB2Dialect
---------------------------------------------
Key: HHH-6864
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-6864
Project: Hibernate Core
Issue Type: Improvement
Components: core
Affects Versions: 3.0 final
Environment: Hibernate 3.0, JBoss 4.2.3 and DB2 luw 9.7
Reporter: Ramalingeswara Rao K V
Our application is throwing the following error due to some incompatible issues with
DB2Dialect.
2011-11-29 11:03:10,638 ERROR java.lang.UnsupportedOperationException: dialect does not
support GUIDs
at org.hibernate.dialect.Dialect.getSelectGUIDString(Dialect.java:754)
at org.hibernate.id.GUIDGenerator.generate(GUIDGenerator.java:50)
at
org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:122)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
at
org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:56)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
at
org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:50)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
The issue seems to be related to the following entry in hibernate xml files.
<generator class="guid" />
*) We would like to know the common <generator> element which is compatible with
ORACLE and DB2, etc.
*) We would like to know how to separate the hbm configurations based on database (ORACLE,
DB2, MYSQL, etc.).
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira