Issues
- Formula failed with quoted NamingStrategyHCANN-46Resolved issue: HCANN-46
- Upgrade pom.xml info on SCM (move to Git)HCANN-37Resolved issue: HCANN-37Emmanuel Bernard
- Add lgpl.txt file to the repositoryHCANN-36Resolved issue: HCANN-36Emmanuel Bernard
- @Index Columns in @MappedSuperClasses don't workHCANN-34Resolved issue: HCANN-34
- Discriminator for Single table per class hierarchy (2.2.4.2) should be optionalHCANN-32Resolved issue: HCANN-32
- Avoid chocking on weird types when property is marked as transient / @TransientHCANN-29Resolved issue: HCANN-29
- Polymorphic Query on named field using @Inheritance(strategy=InheritanceType.JOINED)HCANN-28Resolved issue: HCANN-28
- Audited class with @EmbeddedId and @ManyToOne relationshipHCANN-27Resolved issue: HCANN-27
- Can't have an @Formula attribute in an @EmbeddedIdHCANN-25Resolved issue: HCANN-25
- @PrimaryKeyJoinColumn and @ForeignKey(name = "FOREIGN_FOOBAR") don't work for InheritanceType.JOINEDHCANN-24Resolved issue: HCANN-24
- Update pom to use the new distributationManagement informationHCANN-20Resolved issue: HCANN-20Hardy Ferentschik
- Make sure that the build enforces JDK 5 compilation just like Core does todayHCANN-18Resolved issue: HCANN-18
12 of 12
Formula failed with quoted NamingStrategy
Rejected
Description
Environment
Eclipse Helios
Spring 3.0.3
Hibernate-annotations 3.4.0 GA
Details
Assignee
UnassignedUnassignedReporter
Stanislav ZaluzhskyStanislav ZaluzhskyBug Testcase Reminder (view)
Bug reports should generally be accompanied by a test case!
Bug Testcase Reminder (edit)
Bug reports should generally be accompanied by a test case!
Participants
Stanislav ZaluzhskySteve EbersoleAffects versions
Priority
Major
Details
Details
Assignee
Unassigned
UnassignedReporter
Stanislav Zaluzhsky
Stanislav ZaluzhskyBug Testcase Reminder (view)
Bug reports should generally be accompanied by a test case!
Bug Testcase Reminder (edit)
Bug reports should generally be accompanied by a test case!
Participants
Stanislav Zaluzhsky
Steve Ebersole
Affects versions
Priority
Created April 14, 2012 at 6:14 PM
Updated May 28, 2015 at 5:57 PM
Resolved May 28, 2015 at 5:57 PM
Activity
Steve EbersoleMay 28, 2015 at 5:57 PM
If this were still an issue (and there is no test case, so I cannot verify it is or is not) the proper project to report this under would be HHH.
In my project I use specific NamingStrategy (org.hibernate.cfg.NamingStrategy).
Each column name is wrapped by quotas - _dialect.openQuote() + columnName + _dialect.closeQuote().
Then I try to use a @Formula with one of the property:
@Formula("(select sum(s.\"prodCount\") from SensorEntry as s where s.\"job_id\" = \"id\")")
private Long value;
This transforms into:
select sum(s.job_."prodCount") from SensorEntry as s where s.job_."job_id" = job_."id") as formula24_
Which leads to exception:
19:18:37,268 WARN main JDBCExceptionReporter:100 - SQL Error: 0, SQLState: 3F000
19:18:37,269 ERROR main JDBCExceptionReporter:101 - ERROR: schema "s" does not exist
19:18:37,270 ERROR main AbstractFlushingEventListener:324 - Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: unable to select generated column values
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.persister.entity.AbstractEntityPersister.processGeneratedProperties(AbstractEntityPersister.java:3754)
at org.hibernate.persister.entity.AbstractEntityPersister.processInsertGeneratedProperties(AbstractEntityPersister.java:3703)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:89)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
I suppose that this is because quota literals don't escaped correctly by Hibernate.