[Hibernate-JIRA] Commented: (HHH-160) New query parser does not allow bitwise operations
by Chris Wood (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-160?page=co... ]
Chris Wood commented on HHH-160:
--------------------------------
BTW: the registerFunction line for bit_and and bit_or can take advantage of org.hibernate.dialect.function.VarArgsSQLFunction.
Using this you can get rid of the inner class, and just do the following in the constructor:
registerFunction("bit_not", new SQLFunctionTemplate(Hibernate.INTEGER, "~?1"));
registerFunction("bit_and", new VarArgsSQLFunction(Hibernate.INTEGER, "(", "&", ")"));
registerFunction("bit_or", new VarArgsSQLFunction(Hibernate.INTEGER, "(", "|", ")"));
Note the additional surrounding brackets, this ensures the function-like behaviour rather than using the DB's operator precidence.
> New query parser does not allow bitwise operations
> --------------------------------------------------
>
> Key: HHH-160
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-160
> Project: Hibernate3
> Type: Improvement
> Components: core
> Versions: 3.0 rc 1
> Environment: Hibernate 3.0 rc1, MySQL
> Reporter: Markus Jessenitschnig
> Priority: Minor
>
>
> The new query parser does not allow bitwise operations like bitwise-and and bitwise-or.
> Example:
> SELECT FIRSTNAME, SURNAME FROM EMPLOYEE WHERE (STATUS & 1) > 0
> The Exception is:
> org.hibernate.QueryException: unexpected char: '&'
--
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
19 years, 3 months
[Hibernate-JIRA] Reopened: (HHH-1661) merge of a deleted object results in a insert?
by Emmanuel Bernard (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1661?page=all ]
Emmanuel Bernard reopened HHH-1661:
-----------------------------------
My bad,
If we know for use that it's a detached instance we should throw an exception.
*know for sure* still has to be defined though
> merge of a deleted object results in a insert?
> ----------------------------------------------
>
> Key: HHH-1661
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1661
> Project: Hibernate3
> Type: Bug
> Components: core
> Versions: 3.1.3
> Environment: Hibernate 3.1.3, SQL Server
> Reporter: Tu-Thach
>
>
> A persistent object is loaded from a session and deleted, then close the session. Using that same object in another session and call merge results in the object being inserted into the database. Here's the sample code:
> Session session = factory.getCurrentSession();
> session.beginTransaction();
> MyClass obj = (MyClass)session.load(MyClass.class, new Integer(10));
> session.delete(obj);
> session.getTransaction().commit();
> session = factory.getCurrentSession();
> session.beginTransaction();
> session.merge(obj);
> session.getTransaction().commit();
> Since the object is already deleted, merge could not find it and thus proceeds with a INSERT. Shouldn't it throw an exception instead?
--
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
19 years, 3 months
[Hibernate-JIRA] Created: (EJB-221) TransientObjectException with FetchType.LAZY on @ManyToOne and field access on target entity
by Christian Bauer (JIRA)
TransientObjectException with FetchType.LAZY on @ManyToOne and field access on target entity
--------------------------------------------------------------------------------------------
Key: EJB-221
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-221
Project: Hibernate Entity Manager
Type: Bug
Components: EntityManager
Reporter: Christian Bauer
Priority: Blocker
Attachments: fetchtest.jar
Latest SVN of everything:
em = factory.createEntityManager();
em.getTransaction().begin();
Soldier2 soldier = em.find(Soldier2.class, mickey.getId());
System.out.println("### TRYING TO ACCESS PROXY ID...");
// This triggers a SELECT, it shouldn't
System.out.println("### PROXY ID : " + soldier.getTroop().getId());
// This throws a TransientObjectException
em.flush();
The @ManyToOne troop in Soldier2.java has only FetchType.LAZY, the CascadeType.PERSIST is removed.
I expect the problem to be in CascadingAction PERSIST_ON_FLUSH.noCascade() somewhere, apparently the proxy has no Id anymore during flush-time and is considered transient (how can a proxy be transient?).
The problems appear as soon as I move the annotations from getters to fields in Troop2.java.
The attached tests are for HEM.
--
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
19 years, 3 months