[Hibernate-JIRA] Created: (HHH-6015) Investigate hibernate-infinispan test failures since migration to JUnit4
by Steve Ebersole (JIRA)
Investigate hibernate-infinispan test failures since migration to JUnit4
------------------------------------------------------------------------
Key: HHH-6015
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6015
Project: Hibernate Core
Issue Type: Task
Components: testsuite
Reporter: Steve Ebersole
Assignee: Galder Zamarreno
2 failures, both in {{org.hibernate.test.cache.infinispan.functional.classloader.IsolatedClassLoaderTest}}:
{{testClassLoaderHandlingStandardQueryCache}}
{noformat}
org.hibernate.PersistentObjectException: detached entity passed to persist: org.hibernate.test.cache.infinispan.functional.classloader.Account
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:124)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:62)
at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:813)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:787)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:791)
at org.hibernate.test.cache.infinispan.functional.classloader.ClassLoaderTestDAO.createAccount(ClassLoaderTestDAO.java:146)
at org.hibernate.test.cache.infinispan.functional.classloader.IsolatedClassLoaderTest.setupEntities(IsolatedClassLoaderTest.java:310)
at org.hibernate.test.cache.infinispan.functional.classloader.IsolatedClassLoaderTest.queryTest(IsolatedClassLoaderTest.java:222)
at org.hibernate.test.cache.infinispan.functional.classloader.IsolatedClassLoaderTest.testClassLoaderHandlingStandardQueryCache(IsolatedClassLoaderTest.java:179)
...
{noformat}
{{testIsolatedSetup}}
{noformat}
java.lang.AssertionError: Should not have succeeded in putting acct -- classloader not isolated
at org.junit.Assert.fail(Assert.java:91)
at org.hibernate.test.cache.infinispan.functional.classloader.IsolatedClassLoaderTest.testIsolatedSetup(IsolatedClassLoaderTest.java:155)
...
{noformat}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 10 months
[Hibernate-JIRA] Created: (HHH-5741) @PrimaryKeyJoinColumn(...) is not working equivalently to @JoinColumn(..., insertable = false, updatable = false)
by Karsten Wutzke (JIRA)
@PrimaryKeyJoinColumn(...) is not working equivalently to @JoinColumn(..., insertable = false, updatable = false)
-----------------------------------------------------------------------------------------------------------------
Key: HHH-5741
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5741
Project: Hibernate Core
Issue Type: Bug
Components: annotations, core, entity-manager, metamodel
Affects Versions: 3.6.0
Environment: Hibernate Core 3.6, HSQLDB, JavaSE, Ant
Reporter: Karsten Wutzke
Priority: Critical
When annotating classes with @JoinColumn(..., insertable = false, updatable = false) validation is working as expected:
@ManyToOne
@JoinColumns(value = {@JoinColumn(name = "country_code", referencedColumnName = "country_code", insertable = false, updatable = false), @JoinColumn(name = "state_code", referencedColumnName = "state_code", insertable = false, updatable = false), @JoinColumn(name = "city_name", referencedColumnName = "name", insertable = false, updatable = false)})
private City city = null;
When annotating with the equivalent @PrimaryKeyJoinColumn, e.g.:
@ManyToOne
@PrimaryKeyJoinColumns(value = {@PrimaryKeyJoinColumn(name = "country_code", referencedColumnName = "country_code"), @PrimaryKeyJoinColumn(name = "state_code", referencedColumnName = "state_code"), @PrimaryKeyJoinColumn(name = "city_name", referencedColumnName = "name")})
private City city = null;
... validation fails.
As every child knows (*cough*) @PrimaryKeyJoinColumn(...) is equivalent to @JoinColumn(..., insertable = false, updatable = false). See here:
http://stackoverflow.com/questions/4205628/jpa-is-primarykeyjoincolumn-th...
Stack trace:
Exception in thread "main" javax.persistence.PersistenceException: [PersistenceUnit: geoinfo] Unable to build EntityManagerFactory
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:911)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:57)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:48)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:32)
at tld.geoinfo.Main.main(Main.java:27)
Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: tld.geoinfo.model.ZipArea column: city_name (should be mapped with insert="false" update="false")
at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:675)
at org.hibernate.mapping.PersistentClass.checkPropertyColumnDuplication(PersistentClass.java:697)
at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:719)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:473)
at org.hibernate.mapping.RootClass.validate(RootClass.java:235)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1332)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1835)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:902)
... 4 more
Obviously, @PrimaryKeyJoinColumn is treated to be writable, which is wrong.
I have attached two SSCCE programs using JavaSE, HSQLDB, and Ant. The one uses @JoinColumn and works, whereas the other uses @PrimaryKeyJoinColumn and doesn't work. Just enter "ant run" in a shell.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 10 months
[Hibernate-JIRA] Created: (HHH-6018) Loading data via XML Mapping not properly handling empty XML elements
by Don Smith (JIRA)
Loading data via XML Mapping not properly handling empty XML elements
---------------------------------------------------------------------
Key: HHH-6018
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6018
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.6.2
Reporter: Don Smith
Attachments: AFPROCESS.xml, Process.hbm.xml, ProcessImpl.java
An XML data file that worked with Hibernate 3.3 now throws "org.hibernate.HibernateException: could not parse timestamp string" for an empty XML node corresponding to a timestamp column.
Example Class, hbm mapping and XML data file attached.
com.novell.soa.persist.PersistenceException: org.hibernate.HibernateException: could not parse timestamp string
at com.novell.soa.persist.HibernateDAO.loadData(HibernateDAO.java:533)
at com.novell.soa.persist.HibernateDAO.loadData(HibernateDAO.java:479)
at com.novell.soa.af.impl.persist.ProcessDAOTest.setUp(ProcessDAOTest.java:92)
at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
at junit.extensions.TestSetup.run(TestSetup.java:23)
at com.intellij.junit3.TestRunnerUtil$SuiteMethodWrapper.run(TestRunnerUtil.java:262)
at com.intellij.junit3.JUnit3IdeaTestRunner.doRun(JUnit3IdeaTestRunner.java:109)
at com.intellij.junit3.JUnit3IdeaTestRunner.startRunnerWithArgs(JUnit3IdeaTestRunner.java:43)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:196)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:65)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:115)
Caused by: org.hibernate.HibernateException: could not parse timestamp string
at org.hibernate.type.descriptor.java.JdbcTimestampTypeDescriptor.fromString(JdbcTimestampTypeDescriptor.java:76)
at org.hibernate.type.descriptor.java.JdbcTimestampTypeDescriptor.fromString(JdbcTimestampTypeDescriptor.java:42)
at org.hibernate.type.AbstractStandardBasicType.fromString(AbstractStandardBasicType.java:66)
at org.hibernate.type.AbstractStandardBasicType.fromXMLNode(AbstractStandardBasicType.java:300)
at org.hibernate.property.Dom4jAccessor$ElementGetter.get(Dom4jAccessor.java:229)
at org.hibernate.property.Dom4jAccessor$Dom4jGetter.getForInsert(Dom4jAccessor.java:116)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValuesToInsert(AbstractEntityTuplizer.java:497)
at org.hibernate.persister.entity.AbstractEntityPersister.getPropertyValuesToInsert(AbstractEntityPersister.java:3975)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:289)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:143)
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)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:713)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:701)
at com.novell.soa.persist.HibernateDAO.loadData(HibernateDAO.java:510)
... 27 more
Caused by: java.text.ParseException: Unparseable date: ""
at java.text.DateFormat.parse(DateFormat.java:337)
at org.hibernate.type.descriptor.java.JdbcTimestampTypeDescriptor.fromString(JdbcTimestampTypeDescriptor.java:73)
... 45 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 10 months
[Hibernate-JIRA] Created: (HHH-6017) setFirstResult causes Parameters is not matched exception
by seungu lee (JIRA)
setFirstResult causes Parameters is not matched exception
---------------------------------------------------------
Key: HHH-6017
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6017
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.6.2
Environment: Hibernate environment version :
spring-orm-3.0.4.RELEASE.jar
hibernate-distribution-3.6.2.Final.jar
commons-collections-3.2.1.jar
antlr-2.7.6.jar
dom4j-1.6.1.jar
slf4j-api-1.6.1.jar
Database platform :
Oracle 10g
Reporter: seungu lee
Priority: Critical
setFirstResult function causes "Parameters is not matched Bind var('?') count 2 And parameters counts are 1 [21]" Exception
See below execute log
[2011-03-15 18:46:50] [ERROR]『core.log.exception.InternalException:<init>(32)』
Parameters is not matched
Bind var('?') count 2 And parameters counts are 1 [21]
Query:
select
*
from
( select
row_.*,
rownum rownum_
from
( select
user0_.USER_ID as USER1_0_,
user0_.LOGIN_ID as LOGIN2_0_,
user0_.LOGIN_PASSWD as LOGIN3_0_,
user0_.USER_NAME as USER4_0_,
user0_.USER_DESC as USER5_0_,
user0_.HASH_TYPE as HASH6_0_,
user0_.LAST_ACCESS_TM as LAST7_0_
from
AA_USER user0_ ) row_
where
rownum <= ?/**P*/
)
where
rownum_ > ?/**P*/
/////////////////////
source
import java.util.List;
import org.hibernate.Query;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import com.nbpcorp.newproj.domain.User;
public class UserDAO extends HibernateDaoSupport {
public void init(SessionFactory sessionFactory) {
setSessionFactory(sessionFactory);
}
public List selectUserList() {
Query query = this.getSession().createQuery("from " + User.class.getName());
query.setFirstResult(10);
query.setMaxResults(10 + 1);
List list = query.list();
return list;
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 10 months