[Hibernate-JIRA] Created: (HHH-6317) Retrieving
by Clint Popetz (JIRA)
Retrieving
-----------
Key: HHH-6317
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6317
Project: Hibernate Core
Issue Type: Bug
Components: envers
Affects Versions: 3.6.5
Reporter: Clint Popetz
For the following mapping:
{code}
public class AnEntity extends HibernatePersistedObject {
@Id
@GeneratedValue
private Long id;
@OneToOne(optional=false,mappedBy="anEntity")
private TargetEntity target;
}
public class TargetEntity {
@Id
@GeneratedValue
private Long id;
@ManyToOne
private AnEntity anEntity;
}
{code}
and the following query:
{code}
AuditReaderFactory.get(em).createQuery().
forRevisionsOfEntity(AnEntity.class,false,false).
add(AuditEntity.id().eq(id)).addOrder(AuditEntity.revisionNumber().desc()).
setMaxResults(1).getSingleResult()
{code}
I get an NPE because the there is no EntityConfiguration for TargetEntity, as it is not audited:
{noformat}
java.lang.NullPointerException
at org.hibernate.envers.query.impl.EntitiesAtRevisionQuery.list(EntitiesAtRevisionQuery.java:81)
at org.hibernate.envers.query.impl.AbstractAuditQuery.getSingleResult(AbstractAuditQuery.java:108)
at org.hibernate.envers.entities.mapper.relation.OneToOneNotOwningMapper.mapToEntityFromMap(OneToOneNotOwningMapper.java:82)
at org.hibernate.envers.entities.mapper.MultiPropertyMapper.mapToEntityFromMap(MultiPropertyMapper.java:118)
at org.hibernate.envers.entities.EntityInstantiator.createInstanceFromVersionsEntity(EntityInstantiator.java:100)
at org.hibernate.envers.query.impl.RevisionsOfEntityQuery.list(RevisionsOfEntityQuery.java:135)
at org.hibernate.envers.query.impl.AbstractAuditQuery.getSingleResult(AbstractAuditQuery.java:108)
{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
12 years, 2 months
[Hibernate-JIRA] Created: (HHH-4591) Criteria.createAlias not working for key-many-to-one associations of a composite-id
by Luka (JIRA)
Criteria.createAlias not working for key-many-to-one associations of a composite-id
-----------------------------------------------------------------------------------
Key: HHH-4591
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4591
Project: Hibernate Core
Issue Type: Bug
Components: query-criteria
Affects Versions: 3.3.2, 3.2.7, 3.2.6
Environment: Hibernate 3.2.6.ga, 3.2.7.ga, 3.3.2.ga
Database: Oragle10g
Reporter: Luka
I'm trying to create an alias to apply a filter on a composite primary-key association, but I'm getting an invalid SQL generated by the ctiteria api: in the SQL there is the filter applied in the where, but the join for the alias is missing in the from.
Here is a sample of the problem:
Mappings (I stripped non relevant info):
TableOne.hbm.xml
<hibernate-mapping default-cascade="none">
<class name="TableOne" table="TABLE_ONE" dynamic-insert="false" dynamic-update="false">
<id name="idTableOne" type="java.lang.Long" unsaved-value="null">
<column name="ID_CONTRATTO"/>
<generator class="sequence">
<param name="sequence">S_TABLE_ONE</param>
</generator>
</id>
<set name="tableOneToTableTwo" order-by="ID_TABLE_ONE" lazy="true" fetch="select" inverse="true" cascade="none">
<key>
<column name="ID_TABLE_ONE"/>
</key>
<one-to-many class="TableOneToTableTwo"/>
</set>
</class>
</hibernate-mapping>
TableOneToTableTwo.hbm.xml
<hibernate-mapping default-cascade="none">
<class name="TableOneToTableTwo" table="TABLE_ONE_TO_TABLE_TWO" dynamic-insert="false" dynamic-update="false">
<composite-id name="tableOneToTableTwoPk" class="TableOneToTableTwoPK">
<key-many-to-one name="tableOne" class="TableOne" >
<column name="ID_TABLE_ONE"/>
</key-many-to-one>
<key-many-to-one name="tabelTwo" class="TabelTwo" >
<column name="ID_TABLE_TWO"/>
</key-many-to-one>
</composite-id>
</class>
</hibernate-mapping>
TabelTwo.hbm.xml
<hibernate-mapping default-cascade="none">
<class name="TabelTwo" table="TABLE_TWO" dynamic-insert="false" dynamic-update="false">
<id name="idTableTwo" type="java.lang.Long" unsaved-value="null">
<column name="ID_TABLE_TWO"/>
<generator class="sequence">
<param name="sequence">S_TABLE_TWO</param>
</generator>
</id>
<property name="codTabelTwo" type="java.lang.String">
<column name="COD_TABLE_TWO" not-null="true" unique="false"/>
</property>
</class>
</hibernate-mapping>
Code:
Criteria hibCrit = getSession().createCriteria(TableOne.class);
hibCrit.createAlias("tableOneToTableTwo", "tableOneToTableTwo");
hibCrit.createAlias("tableOneToTableTwo.tableOneToTableTwoPk.tabelTwo", "tabelTwo");
hibCrit.add(Restrictions.eq("tabelTwo.codTabelTwo", "AAA"));
hibCrit.list();
Generated SQL using Oracle10G dialect (I stripped columns in select):
SELECT [...]
FROM TABLE_ONE this_
INNER JOIN TABLE_ONE_TO_TABLE_TWO tabelTwoco1_ ON this_.ID_TABLE_ONE = tabelTwoco1_.ID_TABLE_ONE
WHERE tabelTwo2_.COD_TABLE_TWO = ?
The "tabelTwo2_" should be the sql alias for criteria alias "tabelTwo", but the table and the join are missing in the from...
I also tried using createCriteria:
Criteria hibCrit = getSession().createCriteria(TableOne.class);
hibCrit.createAlias("tableOneToTableTwo", "tableOneToTableTwo");
Criteria tableTwoCrit = hibCrit.createCriteria("tableOneToTableTwo.tableOneToTableTwoPk.tabelTwo", "tabelTwo");
tableTwoCrit.add(Restrictions.eq("tabelTwo.codTabelTwo", "AAA"));
hibCrit.list();
But i get the same sql query.
Also upgrading Hibernate result in the same behavior.
--
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
12 years, 2 months
[Hibernate-JIRA] Created: (HV-456) The MethodValidator could not handle Proxied objects like in EJB environment
by Ingo Bruell (JIRA)
The MethodValidator could not handle Proxied objects like in EJB environment
----------------------------------------------------------------------------
Key: HV-456
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-456
Project: Hibernate Validator
Issue Type: Bug
Components: engine
Affects Versions: 4.2.0.Beta2
Environment: linux, java 1.6.0_24, hibernate-validator-4.2.0.Beta2, JBoss-5.1.0.GA
Reporter: Ingo Bruell
Using the MethodValidator with proxied objects via an interceptor in an ejb environment throws the following exception:
javax.validation.ConstraintDeclarationException: Only the root method of an overridden method in an inheritance hierarchy may be annotated with parameter constraints. The following method itself has no parameter constraints but it is not defined on a sub-type of class de.enexoma.smartmeter.server.facade.config.ResourceBundleFacadeBean: MethodMetaData [method=public abstract java.util.Map de.enexoma.smartmeter.server.facade.ResourceBundleFacade.get(java.lang.String) throws de.enexoma.smartmeter.server.error.EnexomaException, parameterMetaData=[ParameterMetaData [type=class java.lang.String], [index=0], name=arg0], constraints=[], isCascading=false]], constraints=[], isCascading=false, hasParameterConstraints=false]
The method in the "real" class has constraints defined:
public Map<Locale,List<ResourceBundle>> get(@NotNull @Size(min=1)final String appName)
--
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
12 years, 2 months
[Hibernate-JIRA] Created: (HSEARCH-741) NPE using two fulltext filters, one of them matching nothing (some filters only)
by Sanne Grinovero (JIRA)
NPE using two fulltext filters, one of them matching nothing (some filters only)
--------------------------------------------------------------------------------
Key: HSEARCH-741
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-741
Project: Hibernate Search
Issue Type: Bug
Affects Versions: 3.4.0.Final, 3.3.0.Final, 3.2.1, 3.2.0.Final, 3.1.1.GA, 3.1.0.GA
Reporter: Sanne Grinovero
Assignee: Sanne Grinovero
Fix For: 3.5
It seems that some filter implementations are allowed to return null instead of an empty iterator if they don't match any document.
In this case if multiple filters are enabled, and they are eligible for bitset merging, and no matches where found, we get:
{code}java.lang.NullPointerException
org.hibernate.search.filter.AndDocIdSet.findFirstTargetPosition(AndDocIdSet.java:144)
org.hibernate.search.filter.AndDocIdSet.makeDocIdSetOnAgreedBits(AndDocIdSet.java:89)
org.hibernate.search.filter.AndDocIdSet.buildBitSet(AndDocIdSet.java:81)
org.hibernate.search.filter.AndDocIdSet.iterator(AndDocIdSet.java:60)
org.apache.lucene.search.IndexSearcher.searchWithFilter(IndexSearcher.java:550)
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:525)
org.hibernate.search.query.engine.impl.QueryHits.updateTopDocs(QueryHits.java:219)
org.hibernate.search.query.engine.impl.QueryHits.<init>(QueryHits.java:127)
org.hibernate.search.query.engine.impl.HSQueryImpl.getQueryHits(HSQueryImpl.java:419)
org.hibernate.search.query.engine.impl.HSQueryImpl.queryEntityInfos(HSQueryImpl.java:222)
org.hibernate.search.query.hibernate.impl.FullTextQueryImpl.list(FullTextQueryImpl.java:206)
com.example.dao.impl.DaoImpl.search(Unknown Source)
....{code}
--
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
12 years, 2 months
[Hibernate-JIRA] Created: (HHH-6206) ClassNotFoundException: antlr.RecognitionException
by Jürgen Zimmermann (JIRA)
ClassNotFoundException: antlr.RecognitionException
--------------------------------------------------
Key: HHH-6206
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6206
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 4.0.0.Alpha3
Reporter: Jürgen Zimmermann
I tried to upgrade from 3.6.3 to 4.0.0.alpha3, but get this stacktrace:
java.lang.NoClassDefFoundError: antlr/RecognitionException
at org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory.createQueryTranslator(ASTQueryTranslatorFactory.java:59)
at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:98)
at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:122)
at org.hibernate.internal.SessionFactoryImpl.checkNamedQueries(SessionFactoryImpl.java:619)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:438)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1720)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:77)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:894)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:879)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:56)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:48)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:32)
at de.swe1.test.util.AbstractTest.init(AbstractTest.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:119)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:101)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
at $Proxy0.invoke(Unknown Source)
at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)
at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
Caused by: java.lang.ClassNotFoundException: antlr.RecognitionException
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 36 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
12 years, 2 months
[Hibernate-JIRA] Created: (HHH-3706) Audit Table Schema not generated using <annotationconfiguration>
by Kaizer (JIRA)
Audit Table Schema not generated using <annotationconfiguration>
----------------------------------------------------------------
Key: HHH-3706
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3706
Project: Hibernate Core
Issue Type: Bug
Components: envers
Affects Versions: 3.3.1
Reporter: Kaizer
The Ant task to generate the schema for the audit tables generates schema for my entities but none of the Audit tables are. I have used the org.hibernate.tool.ant.EnversHibernateToolTask class.
<target name="schemaexport" depends="compile" description="Exports a generated schema to DB and file">
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.EnversHibernateToolTask" classpathref="hibernate" />
<hibernatetool destdir=".">
<classpath>
<path refid="hibernate"/>
</classpath>
<!--<annotationconfiguration configurationfile="${basedir}/src/config/hibernate.cfg.xml"/>-->
<jpaconfiguration persistenceunit="ConsolePU"/>
<hbm2ddl drop="false" create="true" export="false" outputfilename="versioning-ddl.sql" delimiter=";" format="true" />
</hibernatetool>
</target>
It works on using <jpaconfiguration>.
--
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
12 years, 2 months