[Hibernate-JIRA] Commented: (HHH-1012) Index not created by SchemaUpdate
by Christian Sprajc (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1012?page=c... ]
Christian Sprajc commented on HHH-1012:
---------------------------------------
Yes, its a pain.
> Index not created by SchemaUpdate
> ---------------------------------
>
> Key: HHH-1012
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1012
> Project: Hibernate Core
> Issue Type: Improvement
> Components: metamodel
> Affects Versions: 3.2.5
> Environment: Windows XP, MySQL/PostgreSQL
> Reporter: Xavier Farret
> Priority: Minor
> Attachments: Indexes.patch
>
>
> i'm using an hbm.xml as describe below and the 'hibernate.hbm2ddl.auto' is egal to update.
> <class table="featurestat" name=".....">
> <id name="id" type="long" column="idFeatureStat">
> <generator class="increment"/>
> </id>
> <properties name="fsUniqueValue" unique="true">
> ....
> </properties>
> <property name="frequency" .../>
> <property name="idFatherFeature" index="FeatStatDocExtSectFeat" not-null="true" type="long" column="..."/>
> ....
> </class>
> Indexes for pk or unique key are well created, but the index explicity named 'FeatStatDocExtSectFeat' is never created. If i put the property 'hibernate.hbm2ddl.auto' in the cfg.xml as 'create' the index is created. But in my case i have to set my property 'hibernate.hbm2ddl.auto' to update.
--
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
16 years, 1 month
[Hibernate-JIRA] Commented: (HHH-1012) Index not created by SchemaUpdate
by Thomas Hallgren (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1012?page=c... ]
Thomas Hallgren commented on HHH-1012:
--------------------------------------
We just got bitten hard by the lack of indexes when we upgraded our production site. Why is this patch never applied?
> Index not created by SchemaUpdate
> ---------------------------------
>
> Key: HHH-1012
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1012
> Project: Hibernate Core
> Issue Type: Improvement
> Components: metamodel
> Affects Versions: 3.2.5
> Environment: Windows XP, MySQL/PostgreSQL
> Reporter: Xavier Farret
> Priority: Minor
> Attachments: Indexes.patch
>
>
> i'm using an hbm.xml as describe below and the 'hibernate.hbm2ddl.auto' is egal to update.
> <class table="featurestat" name=".....">
> <id name="id" type="long" column="idFeatureStat">
> <generator class="increment"/>
> </id>
> <properties name="fsUniqueValue" unique="true">
> ....
> </properties>
> <property name="frequency" .../>
> <property name="idFatherFeature" index="FeatStatDocExtSectFeat" not-null="true" type="long" column="..."/>
> ....
> </class>
> Indexes for pk or unique key are well created, but the index explicity named 'FeatStatDocExtSectFeat' is never created. If i put the property 'hibernate.hbm2ddl.auto' in the cfg.xml as 'create' the index is created. But in my case i have to set my property 'hibernate.hbm2ddl.auto' to update.
--
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
16 years, 1 month
[Hibernate-JIRA] Commented: (HHH-465) order by nulls first / last
by Peter Wyczesany (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-465?page=co... ]
Peter Wyczesany commented on HHH-465:
-------------------------------------
Hi,
I'm using PostreSQL 8.3, so it supports nulls last/first
I have mapping via annotations:
@OneToMany(mappedBy="section", fetch=FetchType.LAZY)
@OrderBy(clause="grade DESC, name ASC NULLS LAST, username ASC")
public List<User> getUsers() {
return users;
}
And my ORDER BY clause for fetching this List looks like this:
order by users0_.grade DESC, users0_.name ASC users0_.NULLS users0_.LAST, users0_.username ASC
Is there any possibility to fix this clause?
And when nulls last/first feature will be supported
> order by nulls first / last
> ---------------------------
>
> Key: HHH-465
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-465
> Project: Hibernate Core
> Issue Type: Improvement
> Components: core
> Affects Versions: 3.0.3
> Reporter: Anthony Patricio
> Priority: Minor
> Attachments: CustomNullsFirstInterceptor.java
>
>
> support of nulls first / last in order clause
> "NULLS LAST" is part of the SQL 99 standard.
> The syntax is as follows:
> ORDER BY [COLUMN NAME] [ASC | DESC] [NULLS FIRST | NULLS LAST]
> In different DBs, the sorting of nulls relative to other values is handled differently.
> PostgreSQL - Nulls are considered HIGHER than non-nulls.
> DB2 - Higher
> MSSQL - Lower
> MySQL - Lower
> Oracle - Higher
> The following DBs have supported this functionality:
> DB2 V7
> Oracle 9i
> PostgreSQL, MySQL, SQLServer do not appear to support this from what I can gather.
> see http://forum.hibernate.org/viewtopic.php?t=942176&start=0&postdays=0&post...
--
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
16 years, 1 month
[Hibernate-JIRA] Commented: (HHH-1877) ClassNotFoundException on my entity-name in a join tag
by Guillaume Jeudy (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1877?page=c... ]
Guillaume Jeudy commented on HHH-1877:
--------------------------------------
We are hitting the same issue but with a different usecase:
The mapping is stripped down for simplicity:
<class name="SpecificationImpl" table="SPECIFICATION" entity-name="SpecificationEagerLoad">
<id name="id" column="SPECIFICATION_ID" type="long">
<generator class="assigned" />
</id>
<discriminator column="TYPE_CD" />
<subclass name="CoverageGroupImpl" entity-name="CoverageGroupEagerLoad" discriminator-value="CGS">
<join table="COVERAGE_GROUP_SPECIFICATION">
<key column="SPECIFICATION_ID" />
<property name="annualStatementLine" column="ANNUAL_STATEMENT_LINE_CD" />
</join>
</subclass>
Fails with:
Caused by: org.hibernate.MappingException: class CoverageGroupEagerLoad not found while looking for property: annualStatementLine
at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:279)
at org.hibernate.cfg.HbmBinder.createProperty(HbmBinder.java:2171)
at org.hibernate.cfg.HbmBinder.bindJoin(HbmBinder.java:992)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2104)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2038)
at org.hibernate.cfg.HbmBinder.bindSubclass(HbmBinder.java:820)
at org.hibernate.cfg.HbmBinder.handleSubclass(HbmBinder.java:2217)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2108)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2038)
at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:359)
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:273)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:144)
at org.hibernate.cfg.Configuration.add(Configuration.java:675)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:510)
at org.hibernate.cfg.Configuration.addJar(Configuration.java:624)
... 51 more
Caused by: java.lang.ClassNotFoundException: CoverageGroupEagerLoad
Ive checked hibernate 3.3.1.GA and the bug is still there in HbmBinder.bindJoin() method.
Any plans that this be fixed in the next GA release? The fix appears trivial.
> ClassNotFoundException on my entity-name in a join tag
> ------------------------------------------------------
>
> Key: HHH-1877
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1877
> Project: Hibernate Core
> Issue Type: Bug
> Affects Versions: 3.1.3
> Environment: Hibernate 3.1.3, Spring 1.2.8, Oracle 9I, Windows XP (localhost)
> Reporter: Christian Mineau
> Attachments: HHH-1877.patch, testcase-HHH1877.ZIP
>
>
> I use the attribute "entity-name" in my class mapping, this is for mapping the same object many times on table(s), and all seem to work normally. I found a problem when I tried to join a table on another class mapping, like:
> <class entity-name="categoryDefault" name="ca.cie.pak.CategoryVO" table="CATEGORY">
> <id name="id" column="CATEGORY_ID" type="java.lang.Integer">
> <generator class="native"/>
> </id>
> <property name="name" column="NAME"/>
>
> <bag name="contents" where="priority = 0">
> <key column="CATEGORY_ID" />
> <one-to-many entity-name="ContentSummary"/>
> </bag>
>
> <join table="LAYOUT_CATEGORY">
> <key foreign-key="CATEGORY_ID" column="CATEGORY_ID" />
> <property name="layoutId" column="LAYOUT_ID"/>
> </join>
> </class>
> I found a ClassNotFoundException: categoryDefault. This exception is thrown when the HbmBinder.bindJoin method is called. I see the code and it tries to instantiate a class from the getEntityName and not by the className.
> Someone can answer me if this is a XML mapping error or a real bug and what I need to do.
--
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
16 years, 1 month
[Hibernate-JIRA] Created: (EJB-401) @OneToOne or @ManyToOne references an unknown entity when maven-surefire-test runs without -DforkMode=none property
by Farrukh Najmi (JIRA)
@OneToOne or @ManyToOne references an unknown entity when maven-surefire-test runs without -DforkMode=none property
-------------------------------------------------------------------------------------------------------------------
Key: EJB-401
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-401
Project: Hibernate Entity Manager
Issue Type: Bug
Components: EntityManager
Affects Versions: 3.3.2.GA
Reporter: Farrukh Najmi
Priority: Critical
I have an entity class called Referer that references another entity class called Referenced as follows:
//The class that has a reference
@Entity(name = "acme.Referer")
@Table(name = "REFERER")
@Inheritance(strategy = InheritanceType.JOINED)
public class DeliveryInfoType extends RefererBase {
@ManyToOne(targetEntity = acme.Referenced.class, cascade = {
CascadeType.ALL
})
@JoinColumn(name = "REFERER_REFERENCED_ID")
protected acme.Referenced referenced;
...
}
//The class that is being referenced
@Entity(name = "acme.Referenced")
@Table(name = "REFERENCED")
@Inheritance(strategy = InheritanceType.JOINED)
public class EndpointReferenceType
...
}
The abstract base class for Referer is a mapped superclass called RefererBase as follows:
@MappedSuperclass
public abstract class ExtensibleObjectType {
...
}
When I run a junit test via maven-surefire-plugin while specifying the -DforkMode=none property then the test succeeds.
When I run a junit test via maven-surefire-plugin without specifying the -DforkMode=none property then the test fails when creating the EntityManagerFactory as follows.
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: my-persistence-unit] Unable to configure EntityManagerFactory
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:265)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:125)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
at acme.SomeClass.createEntityManagerFactory(SomeClass.java:278)
at acme.SomeClass.setUp(SomeClass.java:233)
at acme.SomeClass.<init>(SomeClass.java:57)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)
... 57 more
Caused by: org.hibernate.AnnotationException: @OneToOne or @ManyToOne on acme.Referer.referenced references an unknown entity: acme.Referenced
at org.hibernate.cfg.ToOneFkSecondPass.doSecondPass(ToOneFkSecondPass.java:81)
at org.hibernate.cfg.AnnotationConfiguration.processFkSecondPassInOrder(AnnotationConfiguration.java:499)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:304)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1121)
at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1225)
at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:159)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:854)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:191)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:253)
... 67 more
maven-surefire-plugin defines its forkMode property as follows at <http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html>:
forkMode String Option to specify the forking mode. Can be "never", "once" or "always". "none" and "pertest" are also accepted for backwards compatibility. Default value is once.
I am baffled as to why hiberante EntityManager is behaving working when forkMode is set to "none" but fails when forkMode is set to default of "once".
It seems like a classloader related issue. Here are the hibernate related jars in my webapp:
org.hibernate:hibernate-search:jar:3.0.1.GA
org.hibernate:hibernate:jar:3.2.6.ga
org.hibernate:hibernate-entitymanager:jar:3.3.2.GA
org.hibernate:hibernate-commons-annotations:jar:3.0.0.ga
org.hibernate:ejb3-persistence:jar:1.0.1.GA
org.hibernate:hibernate-annotations:jar:3.3.1.GA
This issue may possibly be related to following issue:
<http://opensource.atlassian.com/projects/hibernate/browse/EJB-199>
--
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
16 years, 1 month