[Hibernate-JIRA] Created: (HSEARCH-967) Hibernate Search archetype resolver generated ${project.version} as org.hibernate:hibernate-search-analyzers version
by Karel Piwko (JIRA)
Hibernate Search archetype resolver generated ${project.version} as org.hibernate:hibernate-search-analyzers version
--------------------------------------------------------------------------------------------------------------------
Key: HSEARCH-967
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-967
Project: Hibernate Search
Issue Type: Bug
Components: build
Affects Versions: 4.0.0.CR1
Reporter: Karel Piwko
When an archetype is generated, following dependency is managed by dependencyManagement in hibernate-search-parent. However, the version is not resolved to 4.0.0.CR1 but to actual project version, which is likely 1.0-SNAPSHOT (the default)
{code:xml}
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search-analyzers</artifactId>
</dependency>
{code}
Following error happens:
{code}
[INFO] Building Hibernate Search Quickstart 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.1:generate (default-cli) @ hibernate-search-quickstart >>>
[WARNING] The POM for org.hibernate:hibernate-search-analyzers:jar:1.0-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.977s
[INFO] Finished at: Tue Oct 25 14:52:46 CEST 2011
[INFO] Final Memory: 6M/116M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project hibernate-search-quickstart: Could not resolve dependencies for project org.jboss.wfk.hibernate.search:hibernate-search-quickstart:jar:1.0-SNAPSHOT: Failure to find org.hibernate:hibernate-search-analyzers:jar:1.0-SNAPSHOT in https://repository.jboss.org/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of jboss-public-repository-group has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionExce...
Workaround: Include version by yourself
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 1 month
[Hibernate-JIRA] Created: (HHH-6811) java.lang.ClassCastException when using @JoinColumnsOrFormulas
by Vladimir Tsichevski (JIRA)
java.lang.ClassCastException when using @JoinColumnsOrFormulas
---------------------------------------------------------------
Key: HHH-6811
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6811
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.6.8
Environment: Ubuntu Linux, Oracle 11G DB
Reporter: Vladimir Tsichevski
The following declaration:
@Entity
@Table(name = "SOMETABLE")
public class Process {
@Id
@Column(name = "ID", length = 19, nullable = false)
long id;
@ManyToOne
@JoinColumnsOrFormulas({ @JoinColumnOrFormula(formula=@JoinFormula(value="PARENTID")) })
@Fetch(FetchMode.JOIN)
Process parent;
}
causes the following exception:
java.lang.ClassCastException: org.hibernate.mapping.Formula cannot be cast to org.hibernate.mapping.Column
at org.hibernate.cfg.annotations.TableBinder.bindFk(TableBinder.java:360)
at org.hibernate.cfg.annotations.CollectionBinder.bindCollectionSecondPass(CollectionBinder.java:1460)
at org.hibernate.cfg.annotations.CollectionBinder.bindOneToManySecondPass(CollectionBinder.java:766)
at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:696)
at org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:645)
at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:65)
at org.hibernate.cfg.Configuration.originalSecondPassCompile(Configuration.java:1716)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1423)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1375)
at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1519)
at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:193)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:1100)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904)
...
Note: if I just use:
@ManyToOne @JoinColumn(name = "PARENTID")
everything works well.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 1 month
[Hibernate-JIRA] Commented: (HHH-6700) mysql test failures
by Strong Liu (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6700?page=c... ]
Strong Liu commented on HHH-6700:
---------------------------------
org.hibernate.test.id.uuid.sqlrep.sqlbinary.UUIDBinaryTest#testUsage fails on mysql
by default, hibernate create following DDL
{code}
create table Node (
id binary(16) not null,
name varchar(255),
parent binary(16),
primary key (id)
) ENGINE=InnoDB
{code}
but {quote}When BINARY values are stored, they are right-padded with the pad value to the specified length. {quote} (see http://dev.mysql.com/doc/refman/5.0/en/binary-varbinary.html)
so, the workaround is add a _length_ to the property and set it to 16 (which is the fixed length for UUID)
another example to show this behavior on mysql
{code}
mysql> create table t(c binary(3));
Query OK, 0 rows affected (0.12 sec)
mysql> insert into t set c ='a';
Query OK, 1 row affected (0.03 sec)
mysql> select hex(c), c='a', c='a\0\0' from t;
+--------+-------+-----------+
| hex(c) | c='a' | c='a\0\0' |
+--------+-------+-----------+
| 610000 | 0 | 1 |
+--------+-------+-----------+
1 row in set (0.00 sec)
mysql> select * from t where c = 'a';
Empty set (0.00 sec)
mysql> select * from t where c = 'a\0\0';
+------+
| c |
+------+
| a |
+------+
1 row in set (0.00 sec)
mysql>
{code}
> mysql test failures
> -------------------
>
> Key: HHH-6700
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6700
> Project: Hibernate Core
> Issue Type: Sub-task
> Environment: MySql 51
> Reporter: Strong Liu
>
> org.hibernate.test.hql.ASTParserLoadingTest.testJPAQLQualifiedIdentificationVariablesControl
> org.hibernate.test.hql.ASTParserLoadingTest.testPaginationWithPolymorphicQuery
> org.hibernate.test.hql.ASTParserLoadingTest.testImplicitPolymorphism
> org.hibernate.test.hql.ASTParserLoadingTest.testCachedJoinedAndJoinFetchedManyToOne
> org.hibernate.test.hql.ASTParserLoadingTest.testCachedJoinedAndJoinFetchedOneToMany
> org.hibernate.test.id.uuid.sqlrep.sqlbinary.UUIDBinaryTest.testUsage
> org.hibernate.test.id.uuid.strategy.CustomStrategyTest.testUsage
> org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testLazy
> org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testCustomColumnReadAndWrite
> org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testFetchAll
> org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testLazyManyToOne
> org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testPropertyInitialized
> org.hibernate.test.querycache.QueryCacheTest.testCaseInsensitiveComparison
> org.hibernate.test.sql.hand.query.NativeSQLQueriesTest.testTextTypeInSQLQuery
> org.hibernate.test.sql.hand.query.NativeSQLQueriesTest.testImageTypeInSQLQuery
> org.hibernate.test.tm.CMTTest.testConcurrentCachedDirtyQueries
> org.hibernate.test.sql.hand.custom.mysql.MySQLCustomSQLTest.testScalarStoredProcedure
> org.hibernate.test.sql.hand.custom.mysql.MySQLCustomSQLTest.testParameterHandling
> org.hibernate.test.sql.hand.custom.mysql.MySQLCustomSQLTest.testEntityStoredProcedure
> org.hibernate.test.sql.hand.custom.mysql.MySQLCustomSQLTest.testHandSQL
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 1 month
[Hibernate-JIRA] Created: (HHH-6702) mysql 51 test failures
by Strong Liu (JIRA)
mysql 51 test failures
----------------------
Key: HHH-6702
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6702
Project: Hibernate Core
Issue Type: Sub-task
Reporter: Strong Liu
org.hibernate.test.hql.ASTParserLoadingTest.testJPAQLQualifiedIdentificationVariablesControl
org.hibernate.test.hql.ASTParserLoadingTest.testPaginationWithPolymorphicQuery
org.hibernate.test.hql.ASTParserLoadingTest.testImplicitPolymorphism
org.hibernate.test.hql.ASTParserLoadingTest.testCachedJoinedAndJoinFetchedManyToOne
org.hibernate.test.hql.ASTParserLoadingTest.testCachedJoinedAndJoinFetchedOneToMany
org.hibernate.test.id.uuid.sqlrep.sqlbinary.UUIDBinaryTest.testUsage
org.hibernate.test.id.uuid.strategy.CustomStrategyTest.testUsage
org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testLazy
org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testCustomColumnReadAndWrite
org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testFetchAll
org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testLazyManyToOne
org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testPropertyInitialized
org.hibernate.test.querycache.QueryCacheTest.testCaseInsensitiveComparison
org.hibernate.test.sql.hand.query.NativeSQLQueriesTest.testTextTypeInSQLQuery
org.hibernate.test.sql.hand.query.NativeSQLQueriesTest.testImageTypeInSQLQuery
org.hibernate.test.tm.CMTTest.testConcurrentCachedDirtyQueries
org.hibernate.test.sql.hand.custom.mysql.MySQLCustomSQLTest.testScalarStoredProcedure
org.hibernate.test.sql.hand.custom.mysql.MySQLCustomSQLTest.testParameterHandling
org.hibernate.test.sql.hand.custom.mysql.MySQLCustomSQLTest.testEntityStoredProcedure
org.hibernate.test.sql.hand.custom.mysql.MySQLCustomSQLTest.testHandSQL
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 1 month
[Hibernate-JIRA] Deleted: (HHH-6701) mysql test failures
by Strong Liu (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6701?page=c... ]
Strong Liu deleted HHH-6701:
----------------------------
> mysql test failures
> -------------------
>
> Key: HHH-6701
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6701
> Project: Hibernate Core
> Issue Type: Sub-task
> Environment: MySql 51
> Reporter: Strong Liu
>
> org.hibernate.test.hql.ASTParserLoadingTest.testJPAQLQualifiedIdentificationVariablesControl
> org.hibernate.test.hql.ASTParserLoadingTest.testPaginationWithPolymorphicQuery
> org.hibernate.test.hql.ASTParserLoadingTest.testImplicitPolymorphism
> org.hibernate.test.hql.ASTParserLoadingTest.testCachedJoinedAndJoinFetchedManyToOne
> org.hibernate.test.hql.ASTParserLoadingTest.testCachedJoinedAndJoinFetchedOneToMany
> org.hibernate.test.id.uuid.sqlrep.sqlbinary.UUIDBinaryTest.testUsage
> org.hibernate.test.id.uuid.strategy.CustomStrategyTest.testUsage
> org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testLazy
> org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testCustomColumnReadAndWrite
> org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testFetchAll
> org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testLazyManyToOne
> org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testPropertyInitialized
> org.hibernate.test.querycache.QueryCacheTest.testCaseInsensitiveComparison
> org.hibernate.test.sql.hand.query.NativeSQLQueriesTest.testTextTypeInSQLQuery
> org.hibernate.test.sql.hand.query.NativeSQLQueriesTest.testImageTypeInSQLQuery
> org.hibernate.test.tm.CMTTest.testConcurrentCachedDirtyQueries
> org.hibernate.test.sql.hand.custom.mysql.MySQLCustomSQLTest.testScalarStoredProcedure
> org.hibernate.test.sql.hand.custom.mysql.MySQLCustomSQLTest.testParameterHandling
> org.hibernate.test.sql.hand.custom.mysql.MySQLCustomSQLTest.testEntityStoredProcedure
> org.hibernate.test.sql.hand.custom.mysql.MySQLCustomSQLTest.testHandSQL
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 1 month
[Hibernate-JIRA] Created: (HHH-6810) Commit fails when an explicit flush called before
by Marek Matczak (JIRA)
Commit fails when an explicit flush called before
-------------------------------------------------
Key: HHH-6810
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6810
Project: Hibernate Core
Issue Type: Bug
Components: entity-manager
Affects Versions: 3.6.5
Environment: Hibernate 3.6.5 / HSQLDB 1.8.0.10
Reporter: Marek Matczak
Attachments: hibernate.properties, SomeItem.java, SomeOtherThing.java, SomeUser.java, test-case.zip
We have a simple model: SomeUser may have SomeItems (one-to-many relationship); SomeOtherThing is related neither to SomeUser nor to SomeItem (see the attached files for details).
We register a pre insert event listener in which SomeOtherThings are queried when a new SomeUser is inserted:
{code:title=SomeUserPreInsertEventListenerQueryingSomeOtherThings.java|borderStyle=solid}
public class SomeUserPreInsertEventListenerQueryingSomeOtherThings implements PreInsertEventListener {
private static final long serialVersionUID = 7457725085286340589L;
public boolean onPreInsert(PreInsertEvent event) {
Class<? extends Object> currentClass = event.getEntity().getClass();
if (SomeUser.class.equals(currentClass)) {
event.getSession().createCriteria(SomeOtherThing.class).list();
}
return false;
}
}
{code}
When we try to insert some data, the following code fails:
{code:title=Test.java|borderStyle=solid}
Configuration cfg = new Configuration() // hibernate.properties is loaded here
.addAnnotatedClass(SomeUser.class) //
.addAnnotatedClass(SomeItem.class) //
.addAnnotatedClass(SomeOtherThing.class);//
cfg.getEventListeners().setPreInsertEventListeners(
new PreInsertEventListener[] { new SomeUserPreInsertEventListenerQueryingSomeOtherThings() });
SessionFactory sessionFactory = cfg.buildSessionFactory();
Session session = sessionFactory.openSession();
session.beginTransaction();
SomeUser user = new SomeUser();
user.setName("Some name");
session.save(user);
SomeItem item = new SomeItem();
item.setDescription("Some description");
user.addItem(item);
session.save(item);
// for some reason we want to call a flush here
session.flush(); // 1st flush
session.getTransaction().commit(); // 2nd flush
{code}
Our analysis shown that the 1st flush (which triggers the SomeUserPreInsertEventListenerQueryingSomeOtherThings) left the persistence context in some illegal state so that the commit (which issues another flush) fails:
org.hibernate.HibernateException: Found two representations of same collection: bug.report.model.SomeUser.items
at org.hibernate.engine.Collections.processReachableCollection(Collections.java:175)
at org.hibernate.event.def.FlushVisitor.processCollection(FlushVisitor.java:60)
at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:122)
at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:83)
at org.hibernate.event.def.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:77)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:165)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:219)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:99)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:383)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:133)
If we either didn't call the 1st flush or didn't register the event listener at all, the code would succeed.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 1 month