[Hibernate-JIRA] Created: (HHH-6714) Parentheses dissapear in simple JPQL update query where they should stay
by Peter Gwiazda (JIRA)
Parentheses dissapear in simple JPQL update query where they should stay
------------------------------------------------------------------------
Key: HHH-6714
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6714
Project: Hibernate Core
Issue Type: Bug
Components: entity-manager
Affects Versions: 4.0.0.CR4, 3.6.7
Environment: Tried on Hibernate 3.6.7 and 4.0.0.CR4 with PostgreSQL database
Reporter: Peter Gwiazda
I create simple update query
{noformat}
em.createQuery("update WorkMessage workMessage set workMessage.earnedPrice = -( workMessage.totalCost - :a1 )")
.setParameter("a1", 12.0f)
.executeUpdate();
{noformat}
and the SQL is (yelled by hibernate log)
{noformat}
09:18:10.880 [main] DEBUG org.hibernate.SQL - update work_message set earned_price=-total_cost-?
{noformat}
{{- total_cost - 12}} is not the same as {{- (total_cost - 12)}}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 3 months
[Hibernate-JIRA] Created: (HHH-5937) @Enumerated(EnumType.STRING) not taken into account in an @Embeddable included in another @Embeddable
by Thomas Vanstals (JIRA)
@Enumerated(EnumType.STRING) not taken into account in an @Embeddable included in another @Embeddable
-----------------------------------------------------------------------------------------------------
Key: HHH-5937
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5937
Project: Hibernate Core
Issue Type: Bug
Components: annotations
Affects Versions: 3.6.1
Environment: MySQL 5.1.40 / hibernate-entitymanager 3.6.1.Final
Reporter: Thomas Vanstals
I have a Customer entity containing a collection of Investment.
The Investment ({{@Embeddable}}) class contains a MonetaryAmount.
The MonetaryAmount ({{@Embeddable}}) contains an enumerated property ('currency') annotated with {{(a)Enumerated(EnumType.STRING)}}.
The 'currency' field is mapped to a column having the following definition: {{`currency` int(11) DEFAULT NULL}}. This is not correct. The column definition should be {{`currency` varchar(3) DEFAULT NULL}}.
If a add a MonetaryAmount property in the Customer class, the generated column definition is correct ({{`currency` varchar(3) DEFAULT NULL}}).
{code:title=Customer.java|borderStyle=solid}
@Entity
public class Customer {
@Valid
@ElementCollection(fetch = FetchType.EAGER)
private List<Investment> investments = new ArrayList<Investment>();
}
{code}
{code:title=Investment.java|borderStyle=solid}
@Embeddable
public class Investment {
@Valid @NotNull
private MonetaryAmount amount;
@Column(length = 500) @Length(max = 500)
private String description;
private Date date;
}
{code}
{code:title=MonetaryAmount.java|borderStyle=solid}
@Embeddable
public class MonetaryAmount {
@NotNull
private Double amount;
@Column(length = 3)
@Enumerated(EnumType.STRING)
private CurrencyCode currency;
}
{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
14 years, 3 months
[Hibernate-JIRA] Created: (HHH-6836) some test failures on Oracle
by Strong Liu (JIRA)
some test failures on Oracle
----------------------------
Key: HHH-6836
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6836
Project: Hibernate Core
Issue Type: Bug
Components: testsuite
Reporter: Strong Liu
Assignee: Strong Liu
Priority: Minor
Fix For: 4.0.0.next
_org.hibernate.test.annotations.manytoonewithformula.ManyToOneWithFormulaTest#testManyToOneFromNonPkToNonPk_
this test fails due to it has a _substring_ function in its Formula which oracle doesn't support (Oracle uses _substr_ instead)
_org.hibernate.test.criteria.ComplexJoinAliasTest_ fails due to "identifier too long", moving the inner classes out.
_org.hibernate.test.generatedkeys.seqidentity.SequenceIdentityTest_
this test has a _@RequiresDialect( Oracle9iDialect.class )_ on it, and it is supposed to test generated keys, but in _Oracle9iDialect_, the property Environment.USE_GET_GENERATED_KEYS is set to false by default, which causes hibernate throws _AssertionFailure_ by org.hibernate.engine.jdbc.internal.StatementPreparerImpl.checkAutoGeneratedKeysSupportEnabled()
_org.hibernate.test.annotations.manytoonewithformula.ManyToOneWithFormulaTest.testManyToOneFromNonPkToNonPk_ is failed due to "ORA-00942: table or view does not exist"
the ddl generated is like this
{code}
Unsuccessful: create table product (id number(10,0) not null, description varchar2(255 char) not null, product_idnf char(18) not null unique, primary key (id), unique (product_idnf))
ERROR SchemaExport:427 - ORA-02261: such unique or primary key already exists in the table
{code}
_org.hibernate.test.stateless.fetching.StatelessSessionFetchingTest.testDynamicFetch_ fails due to 'resource' is a keyword on oracle which causes create table failed.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 3 months
[Hibernate-JIRA] Updated: (HHH-1870) org.hibernate.TransientObjectException: object references an unsaved transient
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1870?page=c... ]
Steve Ebersole updated HHH-1870:
--------------------------------
Fix Version/s: (was: 4.0.0.Final)
4.0.1
> org.hibernate.TransientObjectException: object references an unsaved transient
> -------------------------------------------------------------------------------
>
> Key: HHH-1870
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1870
> Project: Hibernate Core
> Issue Type: Bug
> Environment: Hibernate 3.2.0 RC 2 from SVN tunk 2006/06/30
> Reporter: Sergey Vladimirov
> Assignee: Gail Badner
> Fix For: 4.0.1
>
> Attachments: manytoonelazy.zip, patch.txt
>
>
> JUnit test case shows strange error on commit():
> Session session = sessionFactory.openSession();
> Transaction transaction = session.beginTransaction();
> BeanB beanB = new BeanB();
> beanB.setId(1);
> session.save(beanB);
> beanB = (BeanB) session.load(BeanB.class, 1);
> BeanA beanA = new BeanA();
> beanA.setId(2);
> beanA.setParent((BeanB) session.load(BeanB.class, 1));
> session.save(beanA);
> transaction.commit();
> session.close();
> org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: ru.arptek.arpsite.data.manytoonelazy.BeanA.parent -> ru.arptek.arpsite.data.manytoonelazy.BeanB
> at org.hibernate.engine.CascadingAction$9.noCascade(CascadingAction.java:273)
> at org.hibernate.engine.Cascade.cascade(Cascade.java:257)
> at org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:131)
> at org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:121)
> at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:65)
> at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
> at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
> at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
> at org.hibernate.transaction.JTATransaction.commit(JTATransaction.java:135)
> at ru.arptek.arpsite.data.manytoonelazy.TestWithoutCache.testFind(TestWithoutCache.java:57)
> 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:585)
> at junit.framework.TestCase.runTest(TestCase.java:154)
> at junit.framework.TestCase.runBare(TestCase.java:127)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCase.java:118)
> at junit.framework.TestSuite.runTest(TestSuite.java:208)
> at junit.framework.TestSuite.run(TestSuite.java:203)
> at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
> Temporary patch included. May be it is brokes other issue.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 3 months
[Hibernate-JIRA] Commented: (HHH-1268) Unidirection OneToMany causes duplicate key entry violation when removing from list
by Patrick Bauerochse (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1268?page=c... ]
Patrick Bauerochse commented on HHH-1268:
-----------------------------------------
Is there a planned version for the fix yet?
> Unidirection OneToMany causes duplicate key entry violation when removing from list
> -----------------------------------------------------------------------------------
>
> Key: HHH-1268
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1268
> Project: Hibernate Core
> Issue Type: Bug
> Affects Versions: 3.1, 3.5.6, 3.6.0
> Environment: 3.1 final
> MySql 4.1.14 using MYISAM tables
> Reporter: Rex Madden
> Assignee: Gail Badner
> Fix For: 3.2.x, 3.3.x
>
> Attachments: possible_solution.patch, src.zip
>
>
> Simple OneToMany parent/child relationship using the default table structure (2 tables and a join table)
> Add 3 children to the parent. Flush. Remove the first child. Flush throws error:
> Exception in thread "main" org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
> at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:69)
> at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
> at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:202)
> at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:230)
> at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:143)
> at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
> at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
> at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:980)
> at UnidirectionalOneToManyRemoveFromListBug.main(UnidirectionalOneToManyRemoveFromListBug.java:27)
> 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:585)
> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:86)
> Caused by: java.sql.BatchUpdateException: Duplicate key or integrity constraint violation, message from server: "Duplicate entry '5' for key 2"
> at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1461)
> at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:58)
> at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:195)
> ... 11 more
> The problem is that there is a unique key on the relationship table that gets violated. The session removes the last row in the relationship table, then attempts to rewrite the child_id's. It fails since there is a uniqueness constraint on that column.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 3 months