[Hibernate-JIRA] Created: (HHH-2868) SubqueryExpression create wrong sql in the case DetachedCriteria has Subcriteria
by Sunao Suzuki (JIRA)
SubqueryExpression create wrong sql in the case DetachedCriteria has Subcriteria
--------------------------------------------------------------------------------
Key: HHH-2868
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2868
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.5
Environment: oracle
Reporter: Sunao Suzuki
Priority: Critical
SubqueryExpression create wrong sql in the case DetachedCriteria has Subcriteria(inner join).
in the case using DetachedCriteria( has Subcriteria) like below , it's works good.
DetachedCriteria dc = DetachedCriteria.forClass(Person.class);
DetachedCriteria in = dc.createCriteria("emails");
in.add(Restrictions.eq("personEmailId", (long)1));
dc.setProjection(Projections.id());
Criteria c = dc.getExecutableCriteria(session);
c.list();
select this_.PERSON_ID as y0_ from PERSON this_ inner join PERSON_EMAIL personemai1_ on this_.PERSON_ID=personemai1_.FK_PERSON_ID where personemai1_.PERSON_EMAIL_ID=?
But in the case using DetachedCriteria( has Subcriteria) for subquery like below, it doesn't work.
DetachedCriteria dc = DetachedCriteria.forClass(Person.class);
DetachedCriteria in = dc.createCriteria("emails");
in.add(Restrictions.eq("personEmailId", (long)1));
dc.setProjection(Projections.id());
Criteria c = session.createCriteria(Person.class);
c.add(Subqueries.propertyIn("personId", dc));
c.setProjection(Projections.id());
c.list();
select this_.PERSON_ID as y0_ from PERSON this_ where this_.PERSON_ID in (select this0__.PERSON_ID as y0_ from PERSON this0__ where personemai1_.PERSON_EMAIL_ID=?)
I hope fix quickly.
--
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
18 years, 2 months
[Hibernate-JIRA] Created: (HHH-2593) Keyword UNION is prefixed with "this_." in filter conditions
by Frederic Leitenberger (JIRA)
Keyword UNION is prefixed with "this_." in filter conditions
------------------------------------------------------------
Key: HHH-2593
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2593
Project: Hibernate3
Issue Type: Bug
Components: query-hql, query-sql
Affects Versions: 3.2.1
Environment: Oracle 10g: org.hibernate.dialect.OracleDialect
Suse Linux
Hibernate: 3.2.1.ga
Hibernate Annotations: 3.2.1.GA
Reporter: Frederic Leitenberger
Priority: Trivial
I need to use a UNION-Subquery in a Filter condition unless HHH-298 is solved.
But anyway, when using the keyword "union" in the Filter condition it is prefixed with "this_.".
For instance, this ...
@Filter(name = "resellerFilter", condition = "(select cu.resellerId from Customer cu, GeoNumber gn where (cu.id = gn.customerId and gn.id = this_.geoNumberId) UNION select cu.resellerId from Customer cu where cu.detemeTemplateId = this_.id) in (null, :resellerIds)")
... produces this ...
select
...
from
DeTeMe this_
where
(
select
cu.resellerId
from
Customer cu,
GeoNumber gn
where
(
cu.id = gn.customerId
and gn.id = this_.geoNumberId
) this_.UNION select
cu.resellerId
from
Customer cu
where
cu.detemeTemplateId = this_.id
) in (
null, ?
)
and this_.id = ?
--
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
18 years, 2 months
[Hibernate-JIRA] Created: (HHH-2750) Oracle9i dialect do not support SequenceStyleGenerator
by Richard Lee (JIRA)
Oracle9i dialect do not support SequenceStyleGenerator
------------------------------------------------------
Key: HHH-2750
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2750
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.3
Environment: Oracle9i
Reporter: Richard Lee
Attachments: dynamicMap.hbm.xml
In the hibernate.cfg.xml set :
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="hbm2ddl.auto">update</property>
Java Code:
private void createSubnet() {
Session session = HibernateSessionFactory.getSession();
HashMap<String, Object> subNet = new HashMap<String, Object>();
subNet.put("ISDELETE", Boolean.FALSE);
Timestamp now = DateUtil.getNow();
subNet.put("CREATE_TIME", now);
subNet.put("LAST_MODIFY_TIME", now);
Transaction tx = session.beginTransaction();
session.save("SUB_NET", subNet);
tx.commit();
session.flush();
HibernateSessionFactory.closeSession();
}
Exception:
Exception in thread "main" java.lang.NoSuchMethodError: org.hibernate.dialect.Dialect.getCreateSequenceStrings(Ljava/lang/String;II)[Ljava/lang/String;
at org.hibernate.id.enhanced.SequenceStructure.sqlCreateStrings(SequenceStructure.java:97)
at org.hibernate.id.enhanced.SequenceStyleGenerator.sqlCreateStrings(SequenceStyleGenerator.java:168)
at org.hibernate.cfg.Configuration.generateSchemaUpdateScript(Configuration.java:1051)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:140)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:314)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1291)
at com.ultrapower.oe.util.HibernateSessionFactory.rebuildSessionFactory(HibernateSessionFactory.java:89)
at com.ultrapower.oe.util.HibernateSessionFactory.getSession(HibernateSessionFactory.java:63)
--
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
18 years, 2 months
[Hibernate-JIRA] Created: (HHH-2813) CacheableFileTest Failing Because Mapping File Doesn't Exist
by James Carman (JIRA)
CacheableFileTest Failing Because Mapping File Doesn't Exist
------------------------------------------------------------
Key: HHH-2813
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2813
Project: Hibernate3
Issue Type: Bug
Components: testsuite
Reporter: James Carman
Attachments: CacheaableFileTest.patch
When running the test suite from a fresh trunk checkout, I get one little failing test in the maven 2 based build:
junit.framework.AssertionFailedError
at org.hibernate.test.cfg.CacheableFileTest.setUp(CacheableFileTest.java:26)
at org.hibernate.junit.UnitTestCase.runBare(UnitTestCase.java:34)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
I changed the code just a bit (patch attached) to get it to work. This could be a platform issue (I'm on Windows XP Pro SP2), but it'd be nice if it worked on all platforms. Here's what I changed so you don't have to open the patch:
mappingFile = new File( getClass().getClassLoader().getResource( MAPPING ).getFile() );
changes to:
mappingFile = new File( getClass().getClassLoader().getResource( MAPPING ).toURI() );
--
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
18 years, 2 months
[Hibernate-JIRA] Created: (HHH-2822) timestamp extraction functions do not work in SAPDBDialect
by Yossi Tamari (JIRA)
timestamp extraction functions do not work in SAPDBDialect
----------------------------------------------------------
Key: HHH-2822
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2822
Project: Hibernate3
Issue Type: Bug
Components: query-hql
Affects Versions: 3.2.5, 3.2.4.sp1, 3.2.4, 3.2.3, 3.2.2, 3.2.1, 3.2.0.ga, 3.2.0.cr5, 3.2.0.cr4, 3.2.0.cr3, 3.2.0.cr2, 3.2.0 cr1, 3.1.3, 3.2.0.alpha2, 3.2.0.alpha1, 3.1.2, 3.1.1, 3.1, 3.1 rc3, 3.1 rc2, 3.1 rc 1, 3.1 beta 2, 3.1 beta 1, 3.0.5, 3.0.4, 3.0.3, 3.0.2, 3.0.1, 3.0 final, 3.0 rc 1, 3.0 beta 4, 3.0 beta 3, 3.0 beta 2, 3.0 beta 1, 3.0 alpha
Environment: SAPDB 7.6
Reporter: Yossi Tamari
Priority: Minor
There is no registerFunction in the SAPDBDialect for the date extraction SQL functions (extract, day, hour...). Therefore, the inherited registration from Dialect are in effect. However, they all map to extract, which is no supported in SAPDB.
The correct implementation is to register the following functions in SAPDBDialect.java:
registerFunction( "second", new SQLFunctionTemplate(Hibernate.INTEGER, "second(?1)") );
registerFunction( "minute", new SQLFunctionTemplate(Hibernate.INTEGER, "minute(?1)") );
registerFunction( "hour", new SQLFunctionTemplate(Hibernate.INTEGER, "hour(?1)") );
registerFunction( "day", new SQLFunctionTemplate(Hibernate.INTEGER, "day(?1)") );
registerFunction( "month", new SQLFunctionTemplate(Hibernate.INTEGER, "month(?1)") );
registerFunction( "year", new SQLFunctionTemplate(Hibernate.INTEGER, "year(?1)") );
registerFunction( "extract", new SQLFunctionTemplate(Hibernate.INTEGER, "?1(?3)") );
--
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
18 years, 2 months