[Hibernate-JIRA] Created: (HHH-6927) Cannot register a type through configuration if the type is parametrized
by Stephane Nicoll (JIRA)
Cannot register a type through configuration if the type is parametrized
------------------------------------------------------------------------
Key: HHH-6927
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6927
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.6.5
Reporter: Stephane Nicoll
Since I don't want to hardcode @TypeDefs in each class hierarchy that uses a custom type, I am using the {{cfg.registerTypeOverride}} method. This works fine for simple user type but I have a parameterized user type.
In that case, using this method leads to a single user type instance being used and shared for all my entities and no parameter is injected at all. Looking a bit deeper I think I found the culprit in TypeResolver.
{code:java}
public Type heuristicType(String typeName, Properties parameters) throws MappingException {
Type type = basic( typeName );
if ( type != null ) {
return type;
}
try {
Class typeClass = ReflectHelper.classForName( typeName );
if ( typeClass != null ) {
return typeFactory.byClass( typeClass, parameters );
}
}
catch ( ClassNotFoundException ignore ) {
}
return null;
}
{code}
base(typeName) will actually return the type that I have registered. Notice that basic does not take the {{parameters}} argument into account. Since it's not null it just returns that type.
Maybe I did something wrong. I was surprised that cfg actually registers *instances* and not classes. Both @TypeDefs and hbm.xml specifies classes. Maybe adding an option to register a class programmatically?
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years
[Hibernate-JIRA] Created: (HHH-6919) support multiple processor cores during hibernate build
by Vyacheslav (JIRA)
support multiple processor cores during hibernate build
-------------------------------------------------------
Key: HHH-6919
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6919
Project: Hibernate Core
Issue Type: New Feature
Affects Versions: 3.6.9, 4.0.0.Final, 3.6.8
Reporter: Vyacheslav
Priority: Minor
It would be cool if hibernate build could utilize all processor resources. During hibernate build processors are only 25% in average.
Here linux console print during build:
mpstat -P ALL 5 10
10:25:20 AM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle
10:25:25 AM all 14.90 0.00 8.63 2.06 0.10 0.00 0.00 0.00 74.31
10:25:25 AM 0 40.49 0.00 24.90 6.88 0.40 0.00 0.00 0.00 27.33
10:25:25 AM 1 15.26 0.00 7.83 1.20 0.00 0.00 0.00 0.00 75.70
10:25:25 AM 2 4.39 0.00 2.00 0.20 0.00 0.00 0.00 0.00 93.41
10:25:25 AM 3 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00
10:25:25 AM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle
10:25:30 AM all 16.87 0.00 7.22 1.73 0.10 0.00 0.00 0.00 74.09
10:25:30 AM 0 48.15 0.00 25.10 4.53 0.41 0.00 0.00 0.00 21.81
10:25:30 AM 1 8.18 0.00 1.84 1.84 0.00 0.00 0.00 0.00 88.14
10:25:30 AM 2 11.18 0.00 1.80 0.60 0.00 0.00 0.00 0.00 86.43
10:25:30 AM 3 0.41 0.00 0.20 0.00 0.00 0.00 0.00 0.00 99.39
10:25:30 AM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle
10:25:35 AM all 10.73 0.00 6.27 0.40 0.05 0.00 0.00 0.00 82.56
10:25:35 AM 0 28.08 0.00 18.99 1.21 0.20 0.00 0.00 0.00 51.52
10:25:35 AM 1 7.80 0.00 4.40 0.40 0.00 0.00 0.00 0.00 87.40
10:25:35 AM 2 7.26 0.00 1.81 0.00 0.00 0.00 0.00 0.00 90.93
10:25:35 AM 3 0.00 0.00 0.20 0.00 0.00 0.00 0.00 0.00 99.80
10:25:35 AM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle
10:25:40 AM all 16.69 0.00 7.10 1.40 0.10 0.00 0.00 0.00 74.71
10:25:40 AM 0 44.27 0.00 22.13 4.02 0.40 0.00 0.00 0.00 29.18
10:25:40 AM 1 6.61 0.00 2.40 1.40 0.00 0.00 0.00 0.00 89.58
10:25:40 AM 2 16.10 0.00 3.98 0.00 0.00 0.00 0.00 0.00 79.92
10:25:40 AM 3 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00
10:25:40 AM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle
10:25:45 AM all 16.16 0.00 7.72 2.62 0.00 0.00 0.00 0.00 73.49
10:25:45 AM 0 46.41 0.00 22.59 7.60 0.00 0.00 0.00 0.00 23.41
10:25:45 AM 1 8.20 0.00 4.51 2.87 0.00 0.00 0.00 0.00 84.43
10:25:45 AM 2 9.88 0.00 3.50 0.21 0.00 0.00 0.00 0.00 86.42
10:25:45 AM 3 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00
10:25:45 AM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle
10:25:50 AM all 15.52 0.00 7.42 1.71 0.10 0.05 0.00 0.00 75.19
10:25:50 AM 0 37.68 0.00 19.16 5.05 0.42 0.00 0.00 0.00 37.68
10:25:50 AM 1 11.75 0.00 6.19 1.24 0.00 0.00 0.00 0.00 80.82
10:25:50 AM 2 12.68 0.00 3.74 0.62 0.00 0.00 0.00 0.00 82.95
10:25:50 AM 3 0.21 0.00 0.83 0.00 0.00 0.00 0.00 0.00 98.96
10:25:50 AM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle
10:25:55 AM all 16.39 0.00 7.49 2.11 0.05 0.00 0.00 0.00 73.96
10:25:55 AM 0 51.32 0.00 25.56 6.09 0.20 0.20 0.00 0.00 16.63
10:25:55 AM 1 5.02 0.00 1.41 2.41 0.00 0.00 0.00 0.00 91.16
10:25:55 AM 2 9.58 0.00 2.99 0.00 0.00 0.00 0.00 0.00 87.43
10:25:55 AM 3 0.00 0.00 0.20 0.00 0.00 0.00 0.00 0.00 99.80
10:25:55 AM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle
10:26:00 AM all 16.62 0.00 8.18 0.76 0.05 0.00 0.00 0.00 74.39
10:26:00 AM 0 48.99 0.00 24.70 2.43 0.20 0.00 0.00 0.00 23.68
10:26:00 AM 1 11.87 0.00 6.24 0.60 0.00 0.00 0.00 0.00 81.29
10:26:00 AM 2 5.25 0.00 1.62 0.00 0.00 0.00 0.00 0.00 93.13
10:26:00 AM 3 0.40 0.00 0.40 0.00 0.00 0.00 0.00 0.00 99.19
10:26:00 AM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle
10:26:05 AM all 14.08 0.00 10.38 0.00 0.05 0.00 0.00 0.00 75.48
10:26:05 AM 0 18.45 0.00 21.80 0.00 0.21 0.00 0.00 0.00 59.54
10:26:05 AM 1 35.04 0.00 18.16 0.00 0.00 0.00 0.00 0.00 46.79
10:26:05 AM 2 3.84 0.00 1.82 0.00 0.00 0.00 0.00 0.00 94.34
10:26:05 AM 3 0.00 0.00 0.21 0.00 0.00 0.00 0.00 0.00 99.79
10:26:05 AM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle
10:26:10 AM all 23.04 0.00 2.30 0.00 0.00 0.00 0.00 0.00 74.66
10:26:10 AM 0 91.20 0.00 8.20 0.00 0.00 0.00 0.00 0.00 0.60
10:26:10 AM 1 0.60 0.00 0.20 0.00 0.00 0.00 0.00 0.00 99.20
10:26:10 AM 2 0.40 0.00 0.80 0.00 0.00 0.00 0.00 0.00 98.80
10:26:10 AM 3 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00
Average: CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle
Average: all 16.11 0.00 7.25 1.28 0.06 0.01 0.00 0.00 75.29
Average: 0 45.67 0.00 21.29 3.78 0.24 0.02 0.00 0.00 28.99
Average: 1 10.89 0.00 5.24 1.20 0.00 0.00 0.00 0.00 82.67
Average: 2 8.04 0.00 2.40 0.16 0.00 0.00 0.00 0.00 89.40
Average: 3 0.10 0.00 0.20 0.00 0.00 0.00 0.00 0.00 99.70
this was captured in test phase of build
Running org.hibernate.test.jpa.ql.JPAQLComplianceTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.328 sec
Running org.hibernate.test.annotations.generics.GenericsTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.12 sec
Running org.hibernate.test.interceptor.InterceptorTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.122 sec
Running org.hibernate.test.dialect.function.MySQLRoundFunctionTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.049 sec
Running org.hibernate.test.annotations.mappedsuperclass.intermediate.IntermediateMappedSuperclassTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.061 sec
Running org.hibernate.test.util.dtd.EntityResolverTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.062 sec
Running org.hibernate.test.sql.hand.custom.sqlserver.SQLServerCustomSQLTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 sec
Running org.hibernate.test.jpa.fetch.FetchingTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.128 sec
Running org.hibernate.test.legacy.ABCTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.08 sec
Running org.hibernate.test.hql.ASTParserLoadingTest
Tests run: 86, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 11.37 sec
Running org.hibernate.test.collection.map.PersistentMapTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.07 sec
Running org.hibernate.test.id.UseIdentifierRollbackTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.055 sec
Running org.hibernate.test.component.cascading.collection.CascadeToComponentCollectionTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.084 sec
Running org.hibernate.test.usercollection.basic.UserCollectionTypeTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.069 sec
Running org.hibernate.test.collection.set.PersistentSetNonLazyTest
Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.371 sec
Running org.hibernate.test.entitymode.dom4j.basic.Dom4jTest
Why to buy new processor if i cannot use even half of it.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years
[Hibernate-JIRA] Created: (HHH-6926) Strange properyname in errormessage releated to @ManyToMany mappedBy
by Kaj Hejer (JIRA)
Strange properyname in errormessage releated to @ManyToMany mappedBy
--------------------------------------------------------------------
Key: HHH-6926
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6926
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 4.0.0.Final
Reporter: Kaj Hejer
We get the following errormessage when starting our application:
{code}
property-ref [_no_uio_webapps_minestudiermed_domain_base_A_bs] not found on entity [no.uio.webapps.minestudiermed.domain.base.A]
{code}
BUT! The propertyname used in @ManyToMany mappedBy is "bs", not "_no_uio_webapps_minestudiermed_domain_base_A_bs".
This issue is also described at http://stackoverflow.com/questions/3637956/hibernate-failing-by-prependin...
We have the following classes:
Class A:
{code}
@Entity
public class A implements Serializable {
@Id
@Column(name = "resources_id")
public Long id;
@ManyToMany
@JoinTable(name = "RESOURCES_LESSON", joinColumns = @JoinColumn(name = "resources_id", referencedColumnName = "resources_id", insertable = false, updatable = false, nullable = true), inverseJoinColumns = @JoinColumn(name = "kode_fs", referencedColumnName = "kode_fs", nullable = true))
private Set<B> bs = new HashSet<B>();
public Long getId() {
return id;
}
public void setId(final Long id) {
this.id = id;
}
public Set<B> getBs() {
return bs;
}
public void setBs(final Set<B> bs) {
this.bs = bs;
}
}
{code}
Class B:
{code}
@Entity
public class B implements Serializable {
@Id
@Column(name = "ID_FS")
private String idFs;
@Column(name = "KODE_FS")
private Long codeFs;
@ManyToMany(mappedBy = "bs")
private Set<A> as = new HashSet<A>();
public String getIdFs() {
return idFs;
}
public void setIdFs(final String idFs) {
this.idFs = idFs;
}
public Set<A> getAs() {
return as;
}
public void setAs(final Set<A> as) {
this.as = as;
}
public Long getCodeFs() {
return codeFs;
}
public void setCodeFs(final Long codeFs) {
this.codeFs = codeFs;
}
}
{code}
We are using Hibernate 4.0.0.Final and Spring 3.1.0.RELEASE.
Full stacktrace:
{code}
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:157)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:321)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:211)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:288)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:290)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:115)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
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: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountancyDAO': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hibernate.SessionFactory no.uio.webapps.minestudiermed.dao.GenericDAOImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [file:src/main/resources/META-INF/spring/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: property-ref [_no_uio_webapps_minestudiermed_domain_base_A_bs] not found on entity [no.uio.webapps.minestudiermed.domain.base.A]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:287)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:103)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:1)
at org.springframework.test.context.support.DelegatingSmartContextLoader.loadContext(DelegatingSmartContextLoader.java:228)
at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:124)
at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:148)
... 30 more
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hibernate.SessionFactory no.uio.webapps.minestudiermed.dao.GenericDAOImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [file:src/main/resources/META-INF/spring/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: property-ref [_no_uio_webapps_minestudiermed_domain_base_A_bs] not found on entity [no.uio.webapps.minestudiermed.domain.base.A]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:506)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284)
... 45 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [file:src/main/resources/META-INF/spring/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: property-ref [_no_uio_webapps_minestudiermed_domain_base_A_bs] not found on entity [no.uio.webapps.minestudiermed.domain.base.A]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:848)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:790)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:707)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:478)
... 47 more
Caused by: org.hibernate.MappingException: property-ref [_no_uio_webapps_minestudiermed_domain_base_A_bs] not found on entity [no.uio.webapps.minestudiermed.domain.base.A]
at org.hibernate.mapping.PersistentClass.getReferencedProperty(PersistentClass.java:371)
at org.hibernate.cfg.Configuration.originalSecondPassCompile(Configuration.java:1613)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1359)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1724)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1775)
at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.buildSessionFactory(LocalSessionFactoryBuilder.java:184)
at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:314)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
... 57 more
Caused by: org.hibernate.MappingException: property [_no_uio_webapps_minestudiermed_domain_base_A_bs] not found on entity [no.uio.webapps.minestudiermed.domain.base.A]
at org.hibernate.mapping.PersistentClass.getRecursiveProperty(PersistentClass.java:428)
at org.hibernate.mapping.PersistentClass.getReferencedProperty(PersistentClass.java:368)
... 65 more
{code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years
[Hibernate-JIRA] Created: (HHH-6541) ColumnValues.applyColumnValues tests presence of uniqueValue but reads nameValue
by Erik Bertelsen (JIRA)
ColumnValues.applyColumnValues tests presence of uniqueValue but reads nameValue
--------------------------------------------------------------------------------
Key: HHH-6541
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6541
Project: Hibernate Core
Issue Type: Bug
Components: annotations
Affects Versions: 4.0.0.Beta4
Environment: 4.0.0.Beta4, postgresql 9
Reporter: Erik Bertelsen
In https://github.com/hibernate/hibernate-core/blob/master/hibernate-core/sr... in the method applyColumnValues, the following lines are present:
AnnotationValue nameValue = columnAnnotation.value( "name" );
if ( nameValue != null ) {
this.name = nameValue.asString();
}
AnnotationValue uniqueValue = columnAnnotation.value( "unique" );
if ( uniqueValue != null ) {
this.unique = nameValue.asBoolean();
}
Note that this.unique is set from nameValue.asBoolean instead of the intended uniqueValue.asBoolean. This causes an IlleArgumentException (unless nameValue happens to be a valid boolean value). Only uniqueValue seems to be affected, the remaining properties look ok.
Suggested fix:
replace 'this.unique = nameValue.asBoolean();' by 'this.unique = uniqueValue.asBoolean();'
Consequence of this bug: It is not possible to annotate a property of an entity class by:
@Column(name = "someName", unique = true)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years
[Hibernate-JIRA] Issue Comment Edited: (HHH-1673) hql parsed with exception (with clause)
by Erik (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1673?page=c... ]
Erik edited comment on HHH-1673 at 12/29/11 3:29 AM:
-----------------------------------------------------
The remark of Yves-Marie Lainé triggered me to apply this patch as well. It took me some time to figure it out for hibernate tools. So I like to share the recipe.
Hibernate3.jar:
- applied the patch (see attachments above) to hibernate 3.6.9 {{org.hibernate.hql.ast.HqlSqlWalker.java}}
- replaced the classes {{HqlSqlWalker.class}} and {{HqlSqlWalker$WithClauseVisitor.class}} in my {{hibernate3.jar}}
HibernateTools in eclipse Indigo SR1:
- applied it to {{.../plugins/plugins/org.jboss.tools.hibernate4_0_3.4.0.v20111221-0406-H613-Beta1/lib/required/hibernate-core-4.0.0.CR6.jar}} ({{org.hibernate.hql.internal.ast.HqlSqlWalker.java}})
- I did not had the sources at hand so I patched the two generated class files in {{hibernate-core-4.0.0.CR6.jar}} the at path {{org/hibernate/hql/internal/ast/}}.
Up to know I did not experienced any issues with this approach, but there is to some extend a risk.
was (Author: eremmel):
The remark of Yves-Marie Lainé triggered me to apply this patch as well. It took me some time to figure it out for hibernate tools. So I like to share the recipe.
Hibernate3.jar:
- applied the patch (see attachments above) to hibernate 3.6.9 {{org.hibernate.hql.ast.HqlSqlWalker.java}}
- replaced the classes {{HqlSqlWalker.class}} and {{HqlSqlWalker$WithClauseVisitor.class}} in my {{hibernate3.jar}}
HibernateTools in eclipse Indigo SR1:
- applied it to {{.../plugins/plugins/org.jboss.tools.hibernate4_0_3.4.0.v20111221-0406-H613-Beta1/lib/required/hibernate-core-4.0.0.CR6.jar}} ({{org.hibernate.hql.internal.ast.HqlSqlWalker.java}})
- I did not had the sources at hand so I patched the two generated class files in {{hibernate-core-4.0.0.CR6.jar}} the at path {{org/hibernate/hql/internal/ast/}}.
Up to know I did not experienced any issues with this approach, but there is to some extend a risk.
> hql parsed with exception (with clause)
> ---------------------------------------
>
> Key: HHH-1673
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1673
> Project: Hibernate Core
> Issue Type: Deprecation
> Components: query-hql
> Affects Versions: 3.1.3, 3.5.3
> Reporter: Tomasz Bech
> Attachments: HHH-1673.patch, HHH-1673.patch
>
>
> The 'improvement' bug fix: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1520
> has broken working functionality:
> I found that after switching to 3.1.3 following construction is not working any longer:
> (FootnoteTypeBO has collection 'descriptions' and reference to languageBO)
> from FootnoteTypeBO as o
> left outer join o.descriptions as t1
> with (t1.language in (select loid from LanguageBO where name = 'aa'))
> --> exception: 'with-clause referenced two different from-clause elements'.
> There is no implicit join as dewscribed in main anomaly, so it shouldn't cause the problem. So now there is no way to write correct hql/sql, and I don't see any workaround.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years
[Hibernate-JIRA] Commented: (HHH-1673) hql parsed with exception (with clause)
by Erik (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1673?page=c... ]
Erik commented on HHH-1673:
---------------------------
The remark of Yves-Marie Lainé triggered me to apply this patch as well. It took me some time to figure it out for hibernate tools. So I like to share the recipe.
Hibernate3.jar:
- applied the patch (see attachments above) to hibernate 3.6.9 {{org.hibernate.hql.ast.HqlSqlWalker.java}}
- replaced the classes {{HqlSqlWalker.class}} and {{HqlSqlWalker$WithClauseVisitor.class}} in my {{hibernate3.jar}}
HibernateTools in eclipse Indigo SR1:
- applied it to {{.../plugins/plugins/org.jboss.tools.hibernate4_0_3.4.0.v20111221-0406-H613-Beta1/lib/required/hibernate-core-4.0.0.CR6.jar}} ({{org.hibernate.hql.internal.ast.HqlSqlWalker.java}})
- I did not had the sources at hand so I patched the two generated class files in {{hibernate-core-4.0.0.CR6.jar}} the at path {{org/hibernate/hql/internal/ast/}}.
Up to know I did not experienced any issues with this approach, but there is to some extend a risk.
> hql parsed with exception (with clause)
> ---------------------------------------
>
> Key: HHH-1673
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1673
> Project: Hibernate Core
> Issue Type: Deprecation
> Components: query-hql
> Affects Versions: 3.1.3, 3.5.3
> Reporter: Tomasz Bech
> Attachments: HHH-1673.patch, HHH-1673.patch
>
>
> The 'improvement' bug fix: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1520
> has broken working functionality:
> I found that after switching to 3.1.3 following construction is not working any longer:
> (FootnoteTypeBO has collection 'descriptions' and reference to languageBO)
> from FootnoteTypeBO as o
> left outer join o.descriptions as t1
> with (t1.language in (select loid from LanguageBO where name = 'aa'))
> --> exception: 'with-clause referenced two different from-clause elements'.
> There is no implicit join as dewscribed in main anomaly, so it shouldn't cause the problem. So now there is no way to write correct hql/sql, and I don't see any workaround.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years