[Hibernate-JIRA] Created: (HHH-5633) AbstractEmptinessExpression producing incorrect sql for innerselect
by minh huon (JIRA)
AbstractEmptinessExpression producing incorrect sql for innerselect
-------------------------------------------------------------------
Key: HHH-5633
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5633
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.0-Final
Environment: eclipse gallileo windows 7 32 bit mysql
Reporter: minh huon
Attachments: hibernate bug.zip
Attached are the domain objects that are used in question for the query. I cannot see a way to explicitly give an alias to the Restrictions.isNotEmpty when the query produce on the inside of the isNotEmpty is a derived query table.
Looking at the code for version 3.5.0 AbstractEmptinessExpression like number 68:
{code}
String innerSelect = "(select 1 from " + collectionPersister.getTableName()
+ " where "
+ new ConditionFragment().setTableAlias( sqlAlias ).setCondition( ownerKeys, collectionKeys ).toFragmentString()
+ ")";
{code}
The string creation seems to need an alias at the end of the creation to be correct my mysql syntax.
The test case "shipmentQuery" is the one failing to produce the right query.
I'd create a patch but I'm not sure if that is exactly the problem or an I doing something wrong.
--
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, 8 months
[Hibernate-JIRA] Commented: (HHH-1594) Add on-delete="cascade" support to unidirectional *ToOne relationships.
by Martin Beránek (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1594?page=c... ]
Martin Beránek commented on HHH-1594:
-------------------------------------
This option is available in Annotations, so why not in xml mapping file?
> Add on-delete="cascade" support to unidirectional *ToOne relationships.
> -----------------------------------------------------------------------
>
> Key: HHH-1594
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1594
> Project: Hibernate Core
> Issue Type: Improvement
> Components: core
> Environment: Hibernate 3.1.x, any dialect with cascading deletes.
> Reporter: Steve Bazyl
>
> Currently the on-delete="cascade" option is only available on bi-directional/inverse collections. However, there are some instances where we don't want the collections on the parent side of the relationship, creating a unidirection relationship from child to parent. It would be nice to be able to do something like:
> <class name="Parent">
> ....
> </class>
> <class name="Child">
> ...
> <many-to-one name="parent" on-delete="cascade"/>
> </class>
> So that child entries are deleted when the parent goes away. Obviously in this particular example it would be OK to add the collection, but in the actual situation we'd like this in the collection would serve no practical purpose.
> It's not critical by any means -- we can just tewak the schema by hand and that's fine. But it seems like an easy enough thing to add and would make the schema generation/update tools a little more robust.
--
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, 8 months
[Hibernate-JIRA] Commented: (HHH-1829) Allow join on any property using property-ref
by Aaron Kats (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1829?page=c... ]
Aaron Kats commented on HHH-1829:
---------------------------------
Hi,
Has this issue been resolved in later releases (I am interested in 3.5.5)?
Thanks,
Aaron
> Allow join on any property using property-ref
> ---------------------------------------------
>
> Key: HHH-1829
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1829
> Project: Hibernate Core
> Issue Type: New Feature
> Components: metamodel
> Affects Versions: 3.2.0 cr1, 3.2.0.cr2
> Reporter: Maarten Winkels
> Assignee: Anthony Patricio
> Attachments: AbstractJoinTest.java, HHH-1829-3.2.8-SNAPSHOT.patch, HHH-1829-mwinkels.patch, hhh-1829.patch, JoinNoPropertyRefTest.java, JoinPropertyRefTest.java, Person.hbm.xml, Person.java, PersonNoPropertyRef.hbm.xml
>
>
> Currently joining tables for one class (uing the <join...> tag) is only supported for the id property. The property-ref is allowed on the <key..> tag inside the <join..> tag, but this is ignored.
--
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, 8 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
13 years, 8 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
13 years, 8 months