[Hibernate-JIRA] Resolved: (HHH-1743) Wrong order of binding parameters in Restrictions.in for composite primary keys
by Diego Pires Plentz (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1743?page=c... ]
Diego Pires Plentz resolved HHH-1743.
-------------------------------------
Assignee: Diego Pires Plentz
Resolution: Duplicate
> Wrong order of binding parameters in Restrictions.in for composite primary keys
> -------------------------------------------------------------------------------
>
> Key: HHH-1743
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1743
> Project: Hibernate3
> Issue Type: Bug
> Components: query-criteria
> Affects Versions: 3.2.0 cr1
> Environment: Windows XP, Oracle 10g
> Reporter: Viatcheslav Sysoltsev (Slavka)
> Assignee: Diego Pires Plentz
> Attachments: HibernateTest_restrictions_in_parameter_binding.zip
>
> Original Estimate: 1 hour
> Remaining Estimate: 1 hour
>
> There is a table Person with composite primary key:
> PERSON
> primary key fields:
> FAMILY
> NUMBER
> For the Criteria Query like
> List<PersonId> ids = new Vector<PersonId>();
> ids.add(new PersonId("SLAVA1", 10L));
> ids.add(new PersonId("SLAVA2", 20L));
> ids.add(new PersonId("SLAVA3", 30L));
> List<Person> persons = session.createCriteria(Person.class)
> .add(Restrictions.in("id", ids))
> .list();
> the query is generated
> select this_.FAMILY as FAMILY0_0_, this_.NUMBER as NUMBER0_0_ from PERSON this_ where (this_.FAMILY, this_.NUMBER) in ((?, ?), (?, ?), (?, ?))
> The query is right, but the parameters are bound in wrong order, here is the excerpt from the log:
> 16:21:33,221 DEBUG [SQL] select this_.FAMILY as FAMILY0_0_, this_.NUMBER as NUMBER0_0_ from PERSON this_ where (this_.FAMILY, this_.NUMBER) in ((?, ?), (?, ?), (?, ?))
> Hibernate: select this_.FAMILY as FAMILY0_0_, this_.NUMBER as NUMBER0_0_ from PERSON this_ where (this_.FAMILY, this_.NUMBER) in ((?, ?), (?, ?), (?, ?))
> 16:21:33,221 DEBUG [AbstractBatcher] preparing statement
> 16:21:33,330 DEBUG [StringType] binding 'SLAVA1' to parameter: 1
> 16:21:33,330 DEBUG [StringType] binding 'SLAVA2' to parameter: 2
> 16:21:33,330 DEBUG [StringType] binding 'SLAVA3' to parameter: 3
> 16:21:33,330 DEBUG [LongType] binding '10' to parameter: 4
> 16:21:33,330 DEBUG [LongType] binding '20' to parameter: 5
> 16:21:33,330 DEBUG [LongType] binding '30' to parameter: 6
> I've made an example (attached, standalone eclipse project with all libs) which demonstrates the problem, but you need running oracle somewhere to run it. See also bug report HH-708 which is predecessor of this.
> The problem may lay in org.hibernate.criterion.InExpression::getTypedValues.
> Instead of
> for ( int i=0; i<types.length; i++ ) {
> for ( int j=0; j<values.length; j++ ) {
> Object subval = values[j]==null ?
> null :
> actype.getPropertyValues( values[j], EntityMode.POJO )[i];
> list.add( new TypedValue( types[i], subval, EntityMode.POJO ) );
> }
> }
> should be
> for ( int j=0; j<values.length; j++ ) {
> for ( int i=0; i<types.length; i++ ) {
> Object subval = values[j]==null ?
> null :
> actype.getPropertyValues( values[j], EntityMode.POJO )[i];
> list.add( new TypedValue( types[i], subval, EntityMode.POJO ) );
> }
> }
> After change have worked for me. But I am not sure whether the syntax of what's going from Restriction.in is database-specific.
--
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, 4 months
[Hibernate-JIRA] Resolved: (HHH-1832) Expression.in on component object gives parameters til SQL in wrong order.
by Diego Pires Plentz (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1832?page=c... ]
Diego Pires Plentz resolved HHH-1832.
-------------------------------------
Assignee: Diego Pires Plentz
Resolution: Duplicate
> Expression.in on component object gives parameters til SQL in wrong order.
> --------------------------------------------------------------------------
>
> Key: HHH-1832
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1832
> Project: Hibernate3
> Issue Type: Bug
> Components: query-criteria
> Affects Versions: 3.1.2
> Environment: Development in IntellIJ IDEA 4.5.3
> Database:Oracle 10g Enteprise Edition release 10.1.0.2.0
> Reporter: Thomas Andersen
> Assignee: Diego Pires Plentz
> Attachments: HibernateBug.zip, HibernateBugTestCase.java
>
>
> I'm using an Expression.in on a component class with two attributes (one Long and one String). When executing the code I an empty list.
> When using the generated SQL in DBVisualizer adding the variables it returns the expectet list.
> Debug log level and reveals (detailed documentation later in description):
> Parameters are bound in the wrong order:
> Paramters are bound
> ... where (this_.ejerlavskode, this_.matrikelnr) in ((9999, 9999), (01, 03))
> should be 9999, 01, 9999, 03 according to
> ... where (this_.ejerlavskode, this_.matrikelnr) in ((9999, 01), (9999, 03))
> Parameter pairs are by class Matrikelbetegnelse(ejerlavskode=9999, matrikenr=01)
> Hibernate version:
> Hibernate 3.1.2
> Mapping documents:
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE hibernate-mapping PUBLIC
> "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
> <hibernate-mapping
> <class
> name="Sagsadvarsel"
> table="sagsadvarsel"
> >
> <id
> name="id"
> column="id"
> type="long"
> >
> <generator class="native">
> <param name="sequence">sagsadvarsel_id_seq</param>
> </generator>
> </id>
> <version
> name="version"
> column="version"
> type="long"
> />
> <property
> name="datoTid"
> type="java.util.Date"
> update="true"
> insert="true"
> column="datoTid"
> not-null="false"
> />
> <component
> name="matrikelbetegnelse"
> class="Matrikelbetegnelse"
> >
> <property
> name="ejerlavskode"
> type="java.lang.Long"
> update="true"
> insert="true"
> column="ejerlavskode"
> />
> <property
> name="matrikelnr"
> type="java.lang.String"
> update="true"
> insert="true"
> column="matrikelnr"
> length="20"
> />
> </component>
> </class>
> </hibernate-mapping>
> Code between sessionFactory.openSession() and session.close():
> Long ejerlav = new Long(9999);
> final Matrikelbetegnelse[] matrikelbetegnelser = new Matrikelbetegnelse[2];
> matrikelbetegnelser[0] = new Matrikelbetegnelse(ejerlav, "01");
> matrikelbetegnelser[1] = new Matrikelbetegnelse(ejerlav, "03");
> List list = session.createCriteria(Sagsadvarsel.class)
> .add(Expression.in("matrikelbetegnelse",matrikelbetegnelser))
> .list();
> log.debug("list " + list.size());
> import java.util.Date;
> import java.io.Serializable;
> /**
> * @hibernate.class table="sagsadvarsel"
> */
> public class Sagsadvarsel implements Serializable{
> private long id;
> private long version;
> private Date datoTid;
> private Matrikelbetegnelse matrikelbetegnelse;
> /**
> * @return
> * @hibernate.id generator-class="native"
> */
> public long getId() {
> return id;
> }
> public void setId(long id) {
> this.id = id;
> }
> /**
> * Udlever versionsnummer for forekomsten. Feltet ajourføres af Hibernate, som samtidig bruger det til at
> * forhindre samtidig opdatering fra to processer.
> * hibernate.version
> * @return
> */
> public long getVersion() {
> return version;
> }
> public void setVersion(long version) {
> this.version = version;
> }
> /**
> * Udlever datotid (Dato og tidspunkt for sagsadvarsel).
> *
> * @hibernate.property not-null="false"
> * @return datotid
> */
> public Date getDatoTid() {
> return datoTid;
> }
> public void setDatoTid(Date datoTid) {
> this.datoTid = datoTid;
> }
> /**
> * Udlever Matrikelbetegnelse.
> *
> * @hibernate.component
> */
> public Matrikelbetegnelse getMatrikelbetegnelse() {
> return matrikelbetegnelse;
> }
> public void setMatrikelbetegnelse(Matrikelbetegnelse matrikelbetegnelse) {
> this.matrikelbetegnelse = matrikelbetegnelse;
> }
> }
> import java.io.Serializable;
> /**
> */
> public class Matrikelbetegnelse {
> private Long ejerlavskode ;
> private String matrikelnr ;
> public Matrikelbetegnelse() {
> }
> public Matrikelbetegnelse(Long ejerlavskode, String matrikelnummer) {
> this.ejerlavskode = ejerlavskode;
> this.matrikelnr = matrikelnummer;
> }
> /**
> *
> * @return
> * @hibernate.property
> */
> public Long getEjerlavskode() {
> return ejerlavskode;
> }
> public void setEjerlavskode(Long ejerlavskode) {
> this.ejerlavskode = ejerlavskode;
> }
> /**
> *
> * @return
> * @hibernate.property length="20"
> */
> public String getMatrikelnr() {
> return matrikelnr;
> }
> public void setMatrikelnr(String matrikelnr) {
> this.matrikelnr = matrikelnr;
> }
> public boolean equals(Object o) {
> if (this == o) return true;
> if (!(o instanceof Matrikelbetegnelse)) return false;
> final Matrikelbetegnelse matrikelbetegnelse = (Matrikelbetegnelse) o;
> if (!ejerlavskode.equals(matrikelbetegnelse.ejerlavskode)) return false;
> if (!matrikelnr.equals(matrikelbetegnelse.matrikelnr)) return false;
> return true;
> }
> public int hashCode() {
> int result;
> result = ejerlavskode.hashCode();
> result = 29 * result + matrikelnr.hashCode();
> return result;
> }
> }
> Full stack trace of any exception that occurs:
> No exception, just an empty result.
> Name and version of the database you are using:
> Oracle 10g Enteprise Edition release 10.1.0.2.0
> The generated SQL (show_sql=true):
> Hibernate: select this_.id as id34_0_, this_.datoTid as datoTid34_0_, this_.ejerlavskode as ejerlavs3_34_0_, this_.matrikelnr as matrikelnr34_0_, this_.fk_sag_id as fk5_34_0_, this_.brugerId as brugerId34_0_, this_.tidsstempel as tidsstem7_34_0_, this_.gyldig_fra as gyldig8_34_0_, this_.gyldig_til as gyldig9_34_0_, this_.oprind_id as oprind10_34_0_ from tan.sagsadvarsel this_ where (this_.ejerlavskode, this_.matrikelnr) in ((?, ?), (?, ?))
> Debug level Hibernate log excerpt:
> 14:02:58,631 DEBUG [CID= ] [org.hibernate.jdbc.AbstractBatcher.log(AbstractBatcher.java:346)] select this_.id as id34_1_, this_.version as version34_1_, this_.datoTid as datoTid34_1_, this_.ejerlavskode as ejerlavs4_34_1_, this_.matrikelnr as matrikelnr34_1_, this_.fk_sag_id as fk6_34_1_, this_.brugerId as brugerId34_1_, this_.tidsstempel as tidsstem8_34_1_, this_.gyldig_fra as gyldig9_34_1_, this_.gyldig_til as gyldig10_34_1_, this_.oprind_id as oprind11_34_1_, s1_.id as id15_0_, s1_.version as version15_0_, s1_.sagsId as sagsId15_0_, s1_.symbolskNavn as symbolsk4_15_0_, s1_.kms_journalnummer as kms5_15_0_, s1_.journaliseringsDato as journali6_15_0_, s1_.rekvirentRef as rekviren7_15_0_, s1_.enum_sagskategori as enum8_15_0_, s1_.enum_prioritet as enum9_15_0_, s1_.tidsfrist as tidsfrist15_0_, s1_.saerligAftale as saerlig11_15_0_, s1_.matrikelnr as matrikelnr15_0_, s1_.ejerlavskode as ejerlav13_15_0_, s1_.afventAntalHoeringssvar as afventA14_15_0_, s1_.afventAntalSupplDok as afventA15_15_0_, s1_.maaIkkeSlettes as maaIkke16_15_0_, s1_.erForaeldet as erForae17_15_0_, s1_.brugerId as brugerId15_0_, s1_.tidsstempel as tidsste19_15_0_, s1_.gyldig_fra as gyldig20_15_0_, s1_.gyldig_til as gyldig21_15_0_, s1_.oprind_id as oprind22_15_0_, s1_.fk_aktoer_indsender_id as fk23_15_0_, s1_.fk_aktoer_rekvirent_id as fk24_15_0_, s1_.fk_aktoer_revisor_id as fk25_15_0_, s1_.fk_sagsbehandlerteam_id as fk26_15_0_, s1_.fk_sagspakke_id as fk27_15_0_, s1_.fk_sagsresume_id as fk28_15_0_, s1_.aflysningsmeddelelse as aflysni29_15_0_, s1_.fk_samlesag_id as fk30_15_0_ from tan.sagsadvarsel this_ inner join tan.sag s1_ on this_.fk_sag_id=s1_.id where (this_.ejerlavskode, this_.matrikelnr) in ((?, ?), (?, ?)) and not s1_.sagsId=? order by this_.fk_sag_id asc, this_.ejerlavskode asc, this_.matrikelnr asc
> Hibernate: select this_.id as id34_1_, this_.version as version34_1_, this_.datoTid as datoTid34_1_, this_.ejerlavskode as ejerlavs4_34_1_, this_.matrikelnr as matrikelnr34_1_, this_.fk_sag_id as fk6_34_1_, this_.brugerId as brugerId34_1_, this_.tidsstempel as tidsstem8_34_1_, this_.gyldig_fra as gyldig9_34_1_, this_.gyldig_til as gyldig10_34_1_, this_.oprind_id as oprind11_34_1_, s1_.id as id15_0_, s1_.version as version15_0_, s1_.sagsId as sagsId15_0_, s1_.symbolskNavn as symbolsk4_15_0_, s1_.kms_journalnummer as kms5_15_0_, s1_.journaliseringsDato as journali6_15_0_, s1_.rekvirentRef as rekviren7_15_0_, s1_.enum_sagskategori as enum8_15_0_, s1_.enum_prioritet as enum9_15_0_, s1_.tidsfrist as tidsfrist15_0_, s1_.saerligAftale as saerlig11_15_0_, s1_.matrikelnr as matrikelnr15_0_, s1_.ejerlavskode as ejerlav13_15_0_, s1_.afventAntalHoeringssvar as afventA14_15_0_, s1_.afventAntalSupplDok as afventA15_15_0_, s1_.maaIkkeSlettes as maaIkke16_15_0_, s1_.erForaeldet as erForae17_15_0_, s1_.brugerId as brugerId15_0_, s1_.tidsstempel as tidsste19_15_0_, s1_.gyldig_fra as gyldig20_15_0_, s1_.gyldig_til as gyldig21_15_0_, s1_.oprind_id as oprind22_15_0_, s1_.fk_aktoer_indsender_id as fk23_15_0_, s1_.fk_aktoer_rekvirent_id as fk24_15_0_, s1_.fk_aktoer_revisor_id as fk25_15_0_, s1_.fk_sagsbehandlerteam_id as fk26_15_0_, s1_.fk_sagspakke_id as fk27_15_0_, s1_.fk_sagsresume_id as fk28_15_0_, s1_.aflysningsmeddelelse as aflysni29_15_0_, s1_.fk_samlesag_id as fk30_15_0_ from tan.sagsadvarsel this_ inner join tan.sag s1_ on this_.fk_sag_id=s1_.id where (this_.ejerlavskode, this_.matrikelnr) in ((?, ?), (?, ?)) and not s1_.sagsId=? order by this_.fk_sag_id asc, this_.ejerlavskode asc, this_.matrikelnr asc
> 14:02:58,641 DEBUG [CID= ] [org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:424)] preparing statement
> 14:02:58,641 DEBUG [CID= ] [org.hibernate.type.NullableType.nullSafeSet(NullableType.java:79)] binding '9999' to parameter: 1
> 14:02:58,641 DEBUG [CID= ] [org.hibernate.type.NullableType.nullSafeSet(NullableType.java:79)] binding '9999' to parameter: 2
> 14:02:58,641 DEBUG [CID= ] [org.hibernate.type.NullableType.nullSafeSet(NullableType.java:79)] binding '01' to parameter: 3
> 14:02:58,641 DEBUG [CID= ] [org.hibernate.type.NullableType.nullSafeSet(NullableType.java:79)] binding '03' to parameter: 4
> 14:02:58,701 DEBUG [CID= ] [org.hibernate.jdbc.AbstractBatcher.logOpenResults(AbstractBatcher.java:327)] about to open ResultSet (open ResultSets: 0, globally: 0)
--
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, 4 months
[Hibernate-JIRA] Updated: (HBX-623) Add ability in reverse engineering config file to support cascades
by Jeffrey Williams (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-623?page=co... ]
Jeffrey Williams updated HBX-623:
---------------------------------
Attachment: many-to-one-attributes.diff
I found this annoying so I has a crack at it. I have uploaded a patch to implement this.
A few things, I have also added the ability to set a few other things as well:-
fetch-mode
lazy
insert
delete
cascade
Validation is done via changes in the DTD. My DTD skills are fairly week so may need to be looked at.
Currently, you can only select on value for cascade property. I believe that as per the mapping doc you should be able to have more than one. Ie. "persist,merge,evict"
As validation is done via DTD this could be fudged. As I mentioned DTD isn't my strenght.
Hope this is ok.
> Add ability in reverse engineering config file to support cascades
> ------------------------------------------------------------------
>
> Key: HBX-623
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-623
> Project: Hibernate Tools
> Issue Type: New Feature
> Components: reverse-engineer
> Affects Versions: 3.0beta2
> Environment: Hibernate Tools Beta 5
> Reporter: tony anecito
> Priority: Critical
> Fix For: 3.2.1
>
> Attachments: many-to-one-attributes.diff
>
>
> Please add ability to add cascade tag to resultant mapping files in the reveng file. Currently have to modifiy velocity template file
--
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, 4 months
[Hibernate-JIRA] Created: (HHH-3003) Native SQL Query module not able to find the alias for collections when property name is not "*"
by Viral B (JIRA)
Native SQL Query module not able to find the alias for collections when property name is not "*"
-------------------------------------------------------------------------------------------------
Key: HHH-3003
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3003
Project: Hibernate3
Issue Type: Patch
Components: query-sql
Affects Versions: 3.2.5
Environment: Hibernate 3.2.5.ga, Oracle 9i
Reporter: Viral B
Attachments: Native SQL Collection ALias Patch.zip
SQLQueryParser replaces query aliases and property names with corresponding auto generated aliases.
The probelm is if we use {aliasName.*} then everything works fine , but along with {aliasName.*} , if you use {aliasName.propertyName} then it doesnot work if the alias is a collection but works if aliasName is an Entity.
To testify this I created two hibernate files Employee and Department , Department has many employees
I wrote the following testcase,
public void testNativeSqlQueryCollectionAliasDefect() {
String query = "select * from ( select {d.*},{e.*} "
+ " from department d, employee e where d.department_id = e.department_id " +
" ) where {e.id} = 232 ";
getSession().createSQLQuery(query).addEntity("d",Department.class)
.addJoin("e","d.employees" )
.list();
}
The testcase throws following exception,
org.hibernate.QueryException: No column name found for property [id] for alias [e] [select * from ( select {d.*},{e.*} from department d, employee e where d.department_id = e.department_id ) where {e.id} = 232 ]
at org.hibernate.loader.custom.sql.SQLQueryParser.resolveCollectionProperties(SQLQueryParser.java:152)
at org.hibernate.loader.custom.sql.SQLQueryParser.substituteBrackets(SQLQueryParser.java:98)
at org.hibernate.loader.custom.sql.SQLQueryParser.process(SQLQueryParser.java:51)
at org.hibernate.loader.custom.sql.SQLCustomQuery.<init>(SQLCustomQuery.java:110)
at org.hibernate.engine.query.NativeSQLQueryPlan.<init>(NativeSQLQueryPlan.java:47)
at org.hibernate.engine.query.QueryPlanCache.getNativeSQLQueryPlan(QueryPlanCache.java:114)
at org.hibernate.impl.AbstractSessionImpl.getNativeSQLQueryPlan(AbstractSessionImpl.java:137)
at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152)
at com.sony.spe.test.nativeSql.TestPageDAO.testNativeSqlQuery(TestPageDAO.java:117)
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 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)
The following testcase runs fine if instead of {e.id} , we use {d.id} sine alias d is of type entity where as e here is a collection
SQLQueryParser.java Line No: 148
columnAliases = collectionPersister.getCollectionPropertyColumnAliases( propertyName, collectionSuffix );
AbstractCollectionPersister.getCollectionPropertyColumnAliases() uses a wrong Map (collectionPropertyColumnAliases) for looking up the property alias, This method is the culprit.
Fix: Instead of calling getCollectionPropertyColumnAliases bypass and call resolveProperties which works fine
//Existing Code
//columnAliases = collectionPersister.getCollectionPropertyColumnAliases( propertyName, collectionSuffix );
//Added: Viral
columnAliases = new String[]{resolveProperties(aliasName, propertyName)};
Now the test case wors fine and generates the alias : EMPLOYEE1_0_1_ in the below query
select
*
from
( select
d.DEPARTMENT_ID as DEPARTMENT1_1_0_,
d.DEPARTMENT_NAME as DEPARTMENT2_1_0_,
e.DEPARTMENT_ID as DEPARTMENT3_0__,
e.EMPLOYEE_ID as EMPLOYEE1_0__,
e.EMPLOYEE_ID as EMPLOYEE1_0_1_,
e.EMPLOYEE_NAME as EMPLOYEE2_0_1_
from
department d,
employee e
where
d.department_id = e.department_id )
where
EMPLOYEE1_0_1_ = 232
I have attached SQLQueryParser fixed and the test domain files I created for testing purpose
--
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, 4 months
[Hibernate-JIRA] Created: (HV-46) Constraints should not compare against empty string values
by Hayo Schmidt (JIRA)
Constraints should not compare against empty string values
----------------------------------------------------------
Key: HV-46
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-46
Project: Hibernate Validator
Issue Type: Improvement
Components: validators
Affects Versions: 3.0.0.ga
Reporter: Hayo Schmidt
Constraints should not compare against empty input strings nor null values, except for @NotNull/@NotEmpty annotation.
The way many contraints are currently implemented, the validation framework is almost useless for attributes that are allowed to be empty or null. In a web based environment you often have return values of null or empty strings. And you cannot predict, what kind of non-value the browser returns.
For example
- @Min(value=0) leads to an error, if value is empty string. "" is regarded to be less than zero.
- @Digits(integerDigits=4) does not allow an empty input: "Numeric value out of bounds (<4 digits>.<0 digits> expected)"
- @Range(min=0), if empty input: "must be between 0 and 9223372036854775807"
As there are already the @NotNull and the @NotEmpty annotation, there is absolutely no need for comparing other constraints against empty values (except Length min).
Whitespace-only strings should also be taken into account for numerical constraints.
The behaviour should be documented in the Reference Guide.
--
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, 4 months