[Hibernate-JIRA] Created: (HHH-4769) In HQL, function ROUND always returns an Integer, it truncate the decimal part of Double number.
by Andrea Tunesi (JIRA)
In HQL, function ROUND always returns an Integer, it truncate the decimal part of Double number.
------------------------------------------------------------------------------------------------
Key: HHH-4769
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4769
Project: Hibernate Core
Issue Type: Bug
Components: core, entity-manager, query-hql
Affects Versions: 3.3.2
Environment: hibernate 3.3.2, mysql-connector-java-5.1.7, database MYSQL 5.
Reporter: Andrea Tunesi
Priority: Blocker
Running the query "select round(stTmpRiepCap.imponibile,1), round(stTmpRiepCap.ritImponibile,1) from StTmpRiepCap stTmpRiepCap", it always returns an Integer and it always truncate the decimal part of Double number ("stTmpRiepCap.imponibile" and "stTmpRiepCap.ritImponibile" are "java.lang.Double").
Example
REAL VALUE - Imponibile: 1528.57 -- Ritenuta imponibile 266.13
VALUE RETURNED USING ROUND - Imponibile: 1528 -- Ritenuta imponibile 266
--
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
13 years, 7 months
[Hibernate-JIRA] Created: (HHH-5528) Defining an object with an @ElementCollection prevents bulk delete
by Jacob Rhode (JIRA)
Defining an object with an @ElementCollection prevents bulk delete
------------------------------------------------------------------
Key: HHH-5528
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5528
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.5.4
Reporter: Jacob Rhode
The following query to delete a set of records, only works in some circumstances:
{code}
Query query=em.createQuery("DELETE FROM Person");
query.executeUpdate();
{code}
If you use an @ElementCollection and add some data, this query will fail. Example class:
{code:title=Person.java|borderStyle=solid}
@Entity
@Table(name="person")
public class Person implements Comparable<Person> {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name="id")
private long id = 0;
@ElementCollection
@Column(name = "activation_key")
@CollectionTable(name = "activation_key")
private Set<String> activationKey = new HashSet<String>();
}
{code}
The following error is generated while trying to bulk delete:
{code}
2029 [main] ERROR org.hibernate.util.JDBCExceptionReporter - integrity
constraint violation: foreign key no action; FKCEC6E942485388AB
table: ACTIVATION_KEY
{code}
As a result, this means code that formerly worked using a bulk delete, can stop working due to an @ElementCollection being added to the associated Java class.
--
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
13 years, 7 months
[Hibernate-JIRA] Commented: (HHH-1689) unexpected AST node: query -- CASE WHEN THEN subquery
by Dhiego Tosatti (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1689?page=c... ]
Dhiego Tosatti commented on HHH-1689:
-------------------------------------
Do not exist as dynamic query, you must create a formula within the file mapping hbm.xml. As in the example:
<property name="xxx" type="java.lang.Long" update="false" insert="false">
<formula>
(Select max (a.cod) from the table WHERE a.cod = field_mapping)
</ formula>
</ Property>
Created by: CTIC - UNOESC JOAÇABA - SC - BRAZIL
> unexpected AST node: query -- CASE WHEN THEN subquery
> -----------------------------------------------------
>
> Key: HHH-1689
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1689
> Project: Hibernate Core
> Issue Type: Bug
> Components: query-sql
> Environment: Hibernate 3.x
> Oracle 9.2.0
> Reporter: Alejandro Torras
> Original Estimate: 20h
> Remaining Estimate: 20h
>
> Hello,
> I got a <<org.hibernate.hql.ast.QuerySyntaxError: unexpected AST node: query [ >> exception with the following query:
> FROM
> t1 AS vo,
> t2 AS vo2
> WHERE vo2.indIdiomaSistema = 'S'
> AND vo.id.codiIdioma.id = :id_codiIdioma_id
> GROUP BY vo.id.codiTipusIdent.id
> HAVING COUNT(*) BETWEEN
> CASE :estat
> WHEN '1' THEN (SELECT COUNT(*) FROM t2 WHERE ind_idioma_sistema = 'S')
> ELSE 0 END
> AND 4
> ORDER BY vo.nomTipusIdent asc
> It seems that the THEN clause doesn't expect a query that Oracle 9.2 handles properly.
> Regards,
> Alejandro Torras.
--
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
13 years, 7 months
[Hibernate-JIRA] Created: (HHH-5518) @ManyToOne(fetch=FetchType.LAZY) annotation generates always an inner join into a query
by Mathias Arens (JIRA)
@ManyToOne(fetch=FetchType.LAZY) annotation generates always an inner join into a query
---------------------------------------------------------------------------------------
Key: HHH-5518
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5518
Project: Hibernate Core
Issue Type: Bug
Components: query-hql
Affects Versions: 3.5.5
Environment: Java 1.6.0_20, Hibernate-EntityManager 3.5.5-Final, HSQLDB, Oracle 11g
Reporter: Mathias Arens
Attachments: HibernateTest.zip
Hibernate generates a left outer join *plus* a inner join for the same relation into my query.
I have a simple @ManyToOne annotation for a reference from a alert object to a user object:
{code}
public class Alert {
[...]
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "RESPONSIBLE_USER_ID")
private UserDO responsibleUser;
[...]
}
{code}
My jpql query is a little more complex:
{code:sql}
select rra from AlertWithResponsibleUserDO rra left join rra.responsibleUser, TeamDO t, BusinessPartnerSearchDO bps join t.teamMembers tm where rra.businessPartnerId = bps.businessPartnerId and (bps.ratingObjectType = 'STANDARD' or bps.ratingObjectType is null) and bps.analyst = tm.organisationalUnit and t.id = :teamId and rra.severity in (:severities) and bps.locale = :locale and bps.localeBpType = :localeBpType"
{code}
The central outer join definition is this:
{code}
AlertWithResponsibleUserDO rra left join rra.responsibleUser
{code}
But Hibernate keeps creating a left outer join *and* a inner join for this relation whatever I do:
{code:sql}
from
V440_R_ALERTS_WITH_RESP_USER alertwithr0_
left outer join
V004_USER userdo1_
on alertwithr0_.F440_F004_RESPONSIBLE_USER_ID=userdo1_.F004_ID
inner join
V004_USER userdo6_
on alertwithr0_.F440_F004_RESPONSIBLE_USER_ID=userdo6_.F004_ID cross
{code}
I already tried different queries and @ManyToOne attributes but none of them affected the sql outcome. I tried a similar relation in a different context but there it worked. Hibernate generated only a left outer join into the sql query. But I don't know which settings generate the two joins on the same relation.
I have added a simple maven test project. Just unzip the HibernateTest.zip and run 'mvn test'. A starting point for further testing could be the AppTest.testManyToOneInnerJoinIssue() test routine.
Thanks for your help in advance.
--
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
13 years, 7 months
[Hibernate-JIRA] Created: (HHH-5521) HqlSqlWalker transforms two same HQL-Query-trees with "java.util.Date" attribute casted as "date" different.
by Thomas Quathamer (JIRA)
HqlSqlWalker transforms two same HQL-Query-trees with "java.util.Date" attribute casted as "date" different.
------------------------------------------------------------------------------------------------------------
Key: HHH-5521
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5521
Project: Hibernate Core
Issue Type: Bug
Components: core, query-hql
Affects Versions: 3.3.1
Environment: Eclipse, PostgreSQL DB Server 8.3,
Hibernate Annotations 3.4.0.ga,
Hibernate Commons-Annotations-3.4.0.ga,
Hibernate Core-3.3.1.ga,
Hibernate EntityManager 3.4.0.ga
Hibernate Search 3.1.0.ga
Hibernate Validator 3.1.0.ga
Reporter: Thomas Quathamer
Attachments: ASTDumpComp.txt, ASTDumpHoli.txt, ISSUE20100831.7z
Hi,
we have two classes with same attribute "Date modifiedDate".
Example Query:
OK: SELECT name FROM Company entity WHERE CAST(entity.modifiedDate AS date) != current_date()
ERROR: SELECT name FROM Holiday entity WHERE CAST(entity.modifiedDate AS date) != current_date()
Executing the above HQL-queries results in different AST-Nodes for the WHERE clause,
see the two appended AST_LOG files with the node trees
(line 50 in ASTNodeDump_ObjectHoliday marked by me as ERROR).
There is a DotNode instead of an IdentNode in AST_LOG for "java.util.Date" attribute casted as "date".
Where is the differenz?
Thanks, Thomas Quathamer
--
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
13 years, 7 months
[Hibernate-JIRA] Created: (HHH-5522) META-INF/orm.xml in a persistence unit jar is not being picked up
by jaikiran (JIRA)
META-INF/orm.xml in a persistence unit jar is not being picked up
-----------------------------------------------------------------
Key: HHH-5522
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5522
Project: Hibernate Core
Issue Type: Bug
Components: entity-manager
Reporter: jaikiran
Attachments: entity-source.tar.gz, jboss-ejb3-tutorial-entity.jar
Starting JBoss AS 6.0.0.M4 (and even the current AS trunk), the META-INF/orm.xml file in a persistence unit jar file is not being picked up. JBoss AS 6.0.0.M3 picks up that file correctly. Attached is a jar file which contains a META-INF/orm.xml with the following (intentionally invalid) contents:
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm" version="1.0">
<!-- Intentional bogus element, to fail orm.xml parsing (if at all it's picked up) -->
<bogus/>
</entity-mappings>
Place the attached .jar file JBOSS_HOME/server/<servername>/deploy folder and start the server. The deployment _doesn't_ complain of this invalid orm.xml file (Note: This is just a quick way of testing that the META-INF/orm.xml isn't being picked up. The real test where I encountered the issue involved default entity listeners in META-INF/orm.xml not being invoked).
I've also attached the source files of that jar. It contains an Ant build script too - just set JBOSS_HOME and run "ant ejbjar" to deploy to AS.
P.S: JBoss AS 6.0 M4 uses 3.5.2-Final and the current AS trunk uses 3.5.5-Final of Hibernate
--
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
13 years, 7 months