[Hibernate-JIRA] Created: (HHH-3834) Exception: cast() requires two arguments
by Paulo Angelo (JIRA)
Exception: cast() requires two arguments
----------------------------------------
Key: HHH-3834
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3834
Project: Hibernate Core
Issue Type: Bug
Environment: hibernate3, postgresql 8.3
Reporter: Paulo Angelo
Got exaclty the same as in HHH-3285 .:
cast() requires two arguments [select f from MenuItem f where ( ( UPPER( TO_ASCII(CAST(convert(f.Menu.Idme, 'UTF8', 'LATIN1') , TEXT),'LATIN1')) LIKE UPPER( TO_ASCII(CAST(convert('M10', 'UTF8', 'LATIN1') , TEXT),'LATIN1')) ) ) order by f.Orde ASC ]
But there is not a extra ")" (I think, :) )
--
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
15 years, 6 months
[Hibernate-JIRA] Created: (HSEARCH-594) Typos in Hibernate Search documentation
by Emmanuel Bernard (JIRA)
Typos in Hibernate Search documentation
---------------------------------------
Key: HSEARCH-594
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-594
Project: Hibernate Search
Issue Type: Bug
Components: documentation
Affects Versions: 3.3.0.Beta1
Reporter: Emmanuel Bernard
Subject
Typo in Hibernate Search Documentation (HTML, single page)
Message
In section 1.3, there is a typo ("wil" instead of "will") in the
following paragraph:
This leaves us with @IndexedEmbedded. This annotation is used to index
associated entities (@ManyToMany, @*ToOne and @Embedded) as part of
the owning entity. This is needed since a Lucene index document is a
flat data structure which does not know anything about object
relations. To ensure that the authors' name wil be searchable you have
to make sure that the names are indexed as part of the book itself. On
top of @IndexedEmbedded you will also have to mark all fields of the
associated entity you want to have included in the index with
@Indexed. For more details see Section 4.1.3, "Embedded and associated
objects".
--
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
15 years, 6 months
[Hibernate-JIRA] Created: (METAGEN-35) Generated meta model classes does not extend the super class' meta model.
by Joel Ringuette (JIRA)
Generated meta model classes does not extend the super class' meta model.
-------------------------------------------------------------------------
Key: METAGEN-35
URL: http://opensource.atlassian.com/projects/hibernate/browse/METAGEN-35
Project: Hibernate Metamodel Generator
Issue Type: Bug
Components: processor
Affects Versions: 1.0.0.Final
Environment: Maven 2.2.1, Hibernate 3.5.4, maven-processor-plugin 13.6
Reporter: Joel Ringuette
Assignee: Hardy Ferentschik
I'm currently using maven to build a project. I'm using org.bsc.maven.maven-processor-plugin plugin to generate the meta model. In my main source folder, I have a class annotated with @MappedSuperclass.
{code}
@MappedSuperclass
public abstract class BaseEntity
{
// Entity id
@Id
@GeneratedValue
private Long id;
// some more code
}
{code}
In my test source folder, I have a class extending BaseEntity annotated with @Entity
{code}
@Entity()
public class Book extends BaseEntity
{
private String name;
@Column(unique = true)
private String isbn;
@ManyToOne(optional = false)
private Author author;
// some more code
}
{code}
When generating the meta model, the BaseEntity will generate BaseEntity_ and Book will generate Book_. The problem is that Book_ does not extend BaseEntity_
Here is my config of the plugin
{code:xml}
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>1.3.6</version>
<executions>
<execution>
<id>process</id>
<goals>
<goal>process</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<!-- source output directory -->
<outputDirectory>${project.build.sourceDirectory}</outputDirectory>
</configuration>
</execution>
<execution>
<id>process-test</id>
<goals>
<goal>process-test</goal>
</goals>
<phase>generate-test-sources</phase>
<configuration>
<!-- source output directory -->
<outputDirectory>${project.build.testSourceDirectory}</outputDirectory>
<compilerArguments>-Adebug=true</compilerArguments>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<version>1.0.0.Final-Genia</version>
<scope>compile</scope>
</dependency>
</dependencies>
</plugin>
{code}
After looking at the code, the culprit seem to be org.hibernate.jpamodelgen.ClassWriter. In the method printClassDeclaration, we can see the following code:
{code}
if ( context.containsMetaEntity( superClassName )
|| context.containsMetaEmbeddable( superClassName ) ) {
pw.print( " extends " + superClassName + "_" );
}
{code}
It assume the the super class meta model is generated at the same time as the extending class, which is not the case for test-compile and compile. I also assume that it does not work if you extend a class coming from a jar where the meta model was already generated.
To locally fix the problem, I changed the above code for:
{code}
if (((TypeElement) superClassElement).getAnnotation(Entity.class) != null
|| ((TypeElement) superClassElement).getAnnotation(MappedSuperclass.class) != null)
{
pw.print(" extends " + superClassName + "_");
}
{code}
Since it's the first time I use annotation for code generation, I may not have fully understood the problem so feel free to correct me if the above fix is not the correct solution.
Regard,
Joel
--
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
15 years, 6 months
[Hibernate-JIRA] Created: (HHH-5230) Regresion! @SequenceGenerator with allocationSize=1 fails Other allocationSizes appear to be decremented by 1
by Mike Youngstrom (JIRA)
Regresion! @SequenceGenerator with allocationSize=1 fails Other allocationSizes appear to be decremented by 1
-------------------------------------------------------------------------------------------------------------
Key: HHH-5230
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5230
Project: Hibernate Core
Issue Type: Bug
Components: annotations, core
Affects Versions: 3.5.2
Reporter: Mike Youngstrom
When I attempt to upgrade to 3.5.2 I get an error on startup. If I change my allocationSize to 2 then it starts up fine but debugging into LegacyHiLoAlgorithmOptimizer it appears to be using a value of 1.
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: org.lds.stack.stack-pet-store-ws] Unable to build EntityManagerFactory
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:896)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:225)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:308)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1469)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409)
... 38 more
Caused by: org.hibernate.MappingException: Could not instantiate id generator [entity-name=org.lds.stack.petstore.model.Animal]
at org.hibernate.id.factory.DefaultIdentifierGeneratorFactory.createIdentifierGenerator(DefaultIdentifierGeneratorFactory.java:117)
at org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:178)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:257)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1385)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:887)
... 43 more
Caused by: org.hibernate.HibernateException: increment size cannot be less than 1
at org.hibernate.id.enhanced.OptimizerFactory$LegacyHiLoAlgorithmOptimizer.<init>(OptimizerFactory.java:336)
at org.hibernate.id.SequenceHiLoGenerator.configure(SequenceHiLoGenerator.java:64)
at org.hibernate.id.factory.DefaultIdentifierGeneratorFactory.createIdentifierGenerator(DefaultIdentifierGeneratorFactory.java:110)
... 48 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
15 years, 6 months
[Hibernate-JIRA] Created: (HHH-4969) NullPointerException in FromClause.findIntendedAliasedFromElementBasedOnCrazyJPARequirements due to null alias map key
by Jürgen (JIRA)
NullPointerException in FromClause.findIntendedAliasedFromElementBasedOnCrazyJPARequirements due to null alias map key
----------------------------------------------------------------------------------------------------------------------
Key: HHH-4969
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4969
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.2.4.sp1
Environment: Java version: 1.6.0_16,Sun Microsystems Inc.
Java VM: Java HotSpot(TM) 64-Bit Server VM 14.2-b01,Sun Microsystems Inc.
OS-System: Linux 2.6.25.14-69.fc8,amd64
Hibernate 3.2.4.sp1
JBosss-4.2.3.GA
DB2 v8 / JDBC Driver v4.7.85
Reporter: Jürgen
Got a NullPointerException in {{org.hibernate.hql.ast.tree.FromClause.findIntendedAliasedFromElementBasedOnCrazyJPARequirements(String)}} due to fromElementByClassAlias Map key being null.
Only for certain HQL query, along the lines of:
{code}
SELECT c FROM C c, IN(c.t) t, IN(c.k.x) x WHERE
c.k.u = 'K' AND
t.end >= CURRENT_DATE
{code}
Removing {{IN(c.k.x) x}} or {{c.k.u = 'K'}} will not result in a NullPointerException, most likely due to no null alias key put into the map.
specifiedAlias param was "CURRENT_DATE" when findIntendedAliasedFromElementBasedOnCrazyJPARequirements was called.
{code}
private FromElement findIntendedAliasedFromElementBasedOnCrazyJPARequirements(String specifiedAlias) {
...
if ( alias.equalsIgnoreCase( specifiedAlias ) ) { // alias can be null here
..
}
{code}
{code}
java.lang.NullPointerException
at org.hibernate.hql.ast.tree.FromClause.findIntendedAliasedFromElementBasedOnCrazyJPARequirements(FromClause.java:120)
at org.hibernate.hql.ast.tree.FromClause.containsClassAlias(FromClause.java:247)
at org.hibernate.hql.ast.tree.FromClause.isFromElementAlias(FromClause.java:135)
at org.hibernate.hql.ast.HqlSqlWalker.isNonQualifiedPropertyRef(HqlSqlWalker.java:467)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.addrExpr(HqlSqlBaseWalker.java:4382)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.expr(HqlSqlBaseWalker.java:1212)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.exprOrSubquery(HqlSqlBaseWalker.java:4041)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.comparisonExpr(HqlSqlBaseWalker.java:3648)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1762)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1690)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1687)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1687)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.whereClause(HqlSqlBaseWalker.java:776)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:577)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:228)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
at org.hibernate.impl.SessionFactoryImpl.checkNamedQueries(SessionFactoryImpl.java:402)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:352)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:713)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:246)
at sun.reflect.GeneratedMethodAccessor622.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:103)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.server.jmx.LazyMBeanServer.invoke(LazyMBeanServer.java:291)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
{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
15 years, 6 months
[Hibernate-JIRA] Created: (METAGEN-36) Attempt to recreate a file for type
by Radosław Smogura (JIRA)
Attempt to recreate a file for type
------------------------------------
Key: METAGEN-36
URL: http://opensource.atlassian.com/projects/hibernate/browse/METAGEN-36
Project: Hibernate Metamodel Generator
Issue Type: Bug
Components: processor
Affects Versions: 1.0.0.Final
Environment: Netbeans 6.9, Windows
Reporter: Radosław Smogura
Assignee: Hardy Ferentschik
Priority: Critical
When genearting model from entities I got error
"error: Problem with Filer: Attempt to recreate a file for type ...."
The problem looks like when mixing annotations @Embedable and @MappedSuperclass, removing one of those makes generation successful.
Ant stack trace is as follow:
at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1113)
at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:906)
at org.netbeans.modules.java.source.ant.JavacTask.execute(JavacTask.java:136)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor480.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor480.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor480.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
at org.apache.tools.ant.Project.executeTarget(Project.java:1366)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1249)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:281)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:539)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:154)
--
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
15 years, 6 months