[Hibernate-JIRA] Commented: (HV-19) Consider higher level validations, such as email, URL, credit card, etc.
by Diego Pires Plentz (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HV-19?page=com.... ]
Diego Pires Plentz commented on HV-19:
--------------------------------------
> Detect the protocol http / mailto etc, then you can refine the regexp accordingly. Typically mailto can delegate to the EmailValidator
But an email isn't a valid url type, right? So, if someone enter an email instead of an url, we can't accept as a valid url.
> Consider higher level validations, such as email, URL, credit card, etc.
> ------------------------------------------------------------------------
>
> Key: HV-19
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-19
> Project: Hibernate Validator
> Issue Type: New Feature
> Components: validators
> Reporter: Ted Bergeron
> Assignee: Diego Pires Plentz
> Priority: Minor
>
> I was looking at the release notes for commons validator 1.2 http://wiki.apache.org/jakarta-commons/ValidatorVersion120 and wondered if the higher level constructs fit the design goals of hibernate validator.
> They have email, URL, Credit card and ISBN. These could all be handled via @Pattern with regex matching a constant declared somewhere.
> Would it be desirable to have Hibernate supply the values for these constants? Such as:
> @Pattern(type="email") or @Pattern(regex=org.hibernate.validator.Pattern.EMAIL) or @Email
> Email and URL are global patterns. This probably wouldn't work for something like phone number which is locale sensitive.
--
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
17 years, 5 months
[Hibernate-JIRA] Commented: (HV-19) Consider higher level validations, such as email, URL, credit card, etc.
by Emmanuel Bernard (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HV-19?page=com.... ]
Emmanuel Bernard commented on HV-19:
------------------------------------
Detect the protocol http / mailto etc, then you can refine the regexp accordingly. Typically mailto can delegate to the EmailValidator
> Consider higher level validations, such as email, URL, credit card, etc.
> ------------------------------------------------------------------------
>
> Key: HV-19
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-19
> Project: Hibernate Validator
> Issue Type: New Feature
> Components: validators
> Reporter: Ted Bergeron
> Assignee: Diego Pires Plentz
> Priority: Minor
>
> I was looking at the release notes for commons validator 1.2 http://wiki.apache.org/jakarta-commons/ValidatorVersion120 and wondered if the higher level constructs fit the design goals of hibernate validator.
> They have email, URL, Credit card and ISBN. These could all be handled via @Pattern with regex matching a constant declared somewhere.
> Would it be desirable to have Hibernate supply the values for these constants? Such as:
> @Pattern(type="email") or @Pattern(regex=org.hibernate.validator.Pattern.EMAIL) or @Email
> Email and URL are global patterns. This probably wouldn't work for something like phone number which is locale sensitive.
--
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
17 years, 5 months
[Hibernate-JIRA] Updated: (HHH-817) using projections is causing SQL query error on oracle (ORA-00904 error)
by Christian Bauer (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-817?page=co... ]
Christian Bauer updated HHH-817:
--------------------------------
Comment: was deleted
> using projections is causing SQL query error on oracle (ORA-00904 error)
> ------------------------------------------------------------------------
>
> Key: HHH-817
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-817
> Project: Hibernate3
> Issue Type: Bug
> Affects Versions: 3.0.5
> Environment: Oracle 9.2.0.6, Hibernate 3.0.5, Spring Framework 1.2.2 based application working on Jakarta Tomcat 5.0.28
> Reporter: Michal Jastak
> Priority: Minor
> Attachments: HHH-817.patch
>
>
> following java code:
> protected Entity loadEntityLightweight(Serializable entityId) throws DataAccessException {
> Criteria criteria = getSession().createCriteria(Entity.class);
> ProjectionList projectionList = Projections.projectionList();
> projectionList.add(Property.forName(BaseEntity.PROP_ID), BaseEntity.PROP_ID);
> projectionList.add(Property.forName(BaseEntity.PROP_TYPE), BaseEntity.PROP_TYPE);
> criteria.setProjection(projectionList);
> criteria.add(Restrictions.eq(BaseEntity.PROP_ID, entityId));
> criteria.setResultTransformer(new AliasToBeanResultTransformer(Entity.class));
> return (Entity) criteria.uniqueResult();
> }
> generates following SQL query:
> select this_.id as y0_, this_.type as y1_ from entities this_ left outer join facilities this_1_ on this_.id=this_1_.id left outer join users this_2_ on this_.id=this_2_.id left outer join addresses address2_ on this_.address_id=address2_.id left outer join entities entity3_ on this_2_.employer_id=entity3_.id left outer join facilities entity3_1_ on entity3_.id=entity3_1_.id left outer join users entity3_2_ on entity3_.id=entity3_2_.id where y0_=?
> y0_ = ? expression in where clause is causing a 904 error on Oracle 9:
> ORA-00904: "Y0_": invalid identifier
> hibernate dialect: org.hibernate.dialect.Oracle9Dialect
> mapping for Entity class:
> <?xml version="1.0"?>
> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
> <hibernate-mapping default-lazy="false" default-cascade="save-update">
>
> <class name="Entity" table="entities" mutable="true">
> <id name="id" type="java.lang.Long" unsaved-value="null">
> <generator class="sequence">
> <param name="sequence">entities_id_seq</param>
> </generator>
> </id>
> <many-to-one name="address" class="Address" column="address_id" />
> ...
> <!--
> - Facilities
> -->
> <joined-subclass name="Facility" table="facilities">
> <key column="id" />
> ...
> <set name="users" inverse="true" lazy="true">
> <key column="facility_id" />
> <one-to-many class="User" />
> </set>
> </joined-subclass>
> <!--
> - Users
> -->
> <joined-subclass name="User" table="users" dynamic-insert="true" dynamic-update="true">
> <key column="id" />
> <many-to-one name="employer" class="Entity" column="employer_id" cascade="none" />
> ...
> <set name="userAuthorities" inverse="true" cascade="all-delete-orphan">
> <key column="user_id" />
> <one-to-many class="Authority" />
> </set>
> </joined-subclass>
> </class>
> </hibernate-mapping>
--
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
17 years, 5 months
[Hibernate-JIRA] Commented: (HHH-817) using projections is causing SQL query error on oracle (ORA-00904 error)
by Ohad Bruker (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-817?page=co... ]
Ohad Bruker commented on HHH-817:
---------------------------------
Please consider to raise the priority of this issue and solve it once and for all. The resulted SQL query is invalid (all the reasons were already mentioned above).
Currently, the Hibernate developer is required to verify the alias. In cases, that the alias is provided by third party, this is a serious trouble.
> using projections is causing SQL query error on oracle (ORA-00904 error)
> ------------------------------------------------------------------------
>
> Key: HHH-817
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-817
> Project: Hibernate3
> Issue Type: Bug
> Affects Versions: 3.0.5
> Environment: Oracle 9.2.0.6, Hibernate 3.0.5, Spring Framework 1.2.2 based application working on Jakarta Tomcat 5.0.28
> Reporter: Michal Jastak
> Priority: Minor
> Attachments: HHH-817.patch
>
>
> following java code:
> protected Entity loadEntityLightweight(Serializable entityId) throws DataAccessException {
> Criteria criteria = getSession().createCriteria(Entity.class);
> ProjectionList projectionList = Projections.projectionList();
> projectionList.add(Property.forName(BaseEntity.PROP_ID), BaseEntity.PROP_ID);
> projectionList.add(Property.forName(BaseEntity.PROP_TYPE), BaseEntity.PROP_TYPE);
> criteria.setProjection(projectionList);
> criteria.add(Restrictions.eq(BaseEntity.PROP_ID, entityId));
> criteria.setResultTransformer(new AliasToBeanResultTransformer(Entity.class));
> return (Entity) criteria.uniqueResult();
> }
> generates following SQL query:
> select this_.id as y0_, this_.type as y1_ from entities this_ left outer join facilities this_1_ on this_.id=this_1_.id left outer join users this_2_ on this_.id=this_2_.id left outer join addresses address2_ on this_.address_id=address2_.id left outer join entities entity3_ on this_2_.employer_id=entity3_.id left outer join facilities entity3_1_ on entity3_.id=entity3_1_.id left outer join users entity3_2_ on entity3_.id=entity3_2_.id where y0_=?
> y0_ = ? expression in where clause is causing a 904 error on Oracle 9:
> ORA-00904: "Y0_": invalid identifier
> hibernate dialect: org.hibernate.dialect.Oracle9Dialect
> mapping for Entity class:
> <?xml version="1.0"?>
> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
> <hibernate-mapping default-lazy="false" default-cascade="save-update">
>
> <class name="Entity" table="entities" mutable="true">
> <id name="id" type="java.lang.Long" unsaved-value="null">
> <generator class="sequence">
> <param name="sequence">entities_id_seq</param>
> </generator>
> </id>
> <many-to-one name="address" class="Address" column="address_id" />
> ...
> <!--
> - Facilities
> -->
> <joined-subclass name="Facility" table="facilities">
> <key column="id" />
> ...
> <set name="users" inverse="true" lazy="true">
> <key column="facility_id" />
> <one-to-many class="User" />
> </set>
> </joined-subclass>
> <!--
> - Users
> -->
> <joined-subclass name="User" table="users" dynamic-insert="true" dynamic-update="true">
> <key column="id" />
> <many-to-one name="employer" class="Entity" column="employer_id" cascade="none" />
> ...
> <set name="userAuthorities" inverse="true" cascade="all-delete-orphan">
> <key column="user_id" />
> <one-to-many class="Authority" />
> </set>
> </joined-subclass>
> </class>
> </hibernate-mapping>
--
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
17 years, 5 months
[Hibernate-JIRA] Commented: (HHH-1829) Allow join on any property using property-ref
by Arek (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1829?page=c... ]
Arek commented on HHH-1829:
---------------------------
Hi,
can anyone attach the working .jar file? I tried to create .jar file using ant, jre1.5 and hibernate patched source files 3.2.0.cr2 and it doesn't work. All test don't pass.
This is what i get when i try to run (compilation goes fine):
[Exception]: 1
java.lang.ArrayIndexOutOfBoundsException: 1
at org.hibernate.sql.OracleJoinFragment.addJoin(OracleJoinFragment.java:26)
at org.hibernate.persister.entity.AbstractEntityPersister.createJoin(AbstractEntityPersister.java:2616)
at org.hibernate.persister.entity.AbstractEntityPersister.fromJoinFragment(AbstractEntityPersister.java:2589)
at org.hibernate.persister.entity.AbstractEntityPersister.generateSnapshotSelectString(AbstractEntityPersister.java:1146)
at org.hibernate.persister.entity.AbstractEntityPersister.postConstruct(AbstractEntityPersister.java:2756)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:386)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:223)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1213)
at com.tests.OssTests.testACount(OssTests.java:89)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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 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:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
Please help. Thanks
> Allow join on any property using property-ref
> ---------------------------------------------
>
> Key: HHH-1829
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1829
> Project: Hibernate3
> Issue Type: New Feature
> Components: metamodel
> Affects Versions: 3.2.0 cr1, 3.2.0.cr2
> Reporter: Maarten Winkels
> Assignee: Steve Ebersole
> Attachments: AbstractJoinTest.java, HHH-1829-mwinkels.patch, hhh-1829.patch, JoinNoPropertyRefTest.java, JoinPropertyRefTest.java, Person.hbm.xml, Person.java, PersonNoPropertyRef.hbm.xml
>
>
> Currently joining tables for one class (uing the <join...> tag) is only supported for the id property. The property-ref is allowed on the <key..> tag inside the <join..> tag, but this is ignored.
--
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
17 years, 5 months
[Hibernate-JIRA] Commented: (HV-19) Consider higher level validations, such as email, URL, credit card, etc.
by Alex Marshall (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HV-19?page=com.... ]
Alex Marshall commented on HV-19:
---------------------------------
I think we should probably be taking hints from the RFC for URIs on this one: http://www.ietf.org/rfc/rfc2396.txt , specifically the ones relating to HTTP, S/FTP, and similar. I think URIs such as mailto: may have to be excluded because their syntax differs too much from HTTP et al
> Consider higher level validations, such as email, URL, credit card, etc.
> ------------------------------------------------------------------------
>
> Key: HV-19
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-19
> Project: Hibernate Validator
> Issue Type: New Feature
> Components: validators
> Reporter: Ted Bergeron
> Assignee: Diego Pires Plentz
> Priority: Minor
>
> I was looking at the release notes for commons validator 1.2 http://wiki.apache.org/jakarta-commons/ValidatorVersion120 and wondered if the higher level constructs fit the design goals of hibernate validator.
> They have email, URL, Credit card and ISBN. These could all be handled via @Pattern with regex matching a constant declared somewhere.
> Would it be desirable to have Hibernate supply the values for these constants? Such as:
> @Pattern(type="email") or @Pattern(regex=org.hibernate.validator.Pattern.EMAIL) or @Email
> Email and URL are global patterns. This probably wouldn't work for something like phone number which is locale sensitive.
--
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
17 years, 5 months
[Hibernate-JIRA] Commented: (HV-19) Consider higher level validations, such as email, URL, credit card, etc.
by Diego Pires Plentz (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HV-19?page=com.... ]
Diego Pires Plentz commented on HV-19:
--------------------------------------
To solve this (we have just @URL to be done), I just looking for a good URL regex. Docs, unit tests, annotation and validation classes already done. If someone have a good one, please, comment ;-)
Another thing: Do you think that we must accept any protocols like ftp, news, etc, or just http / https?
> Consider higher level validations, such as email, URL, credit card, etc.
> ------------------------------------------------------------------------
>
> Key: HV-19
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-19
> Project: Hibernate Validator
> Issue Type: New Feature
> Components: validators
> Reporter: Ted Bergeron
> Assignee: Diego Pires Plentz
> Priority: Minor
>
> I was looking at the release notes for commons validator 1.2 http://wiki.apache.org/jakarta-commons/ValidatorVersion120 and wondered if the higher level constructs fit the design goals of hibernate validator.
> They have email, URL, Credit card and ISBN. These could all be handled via @Pattern with regex matching a constant declared somewhere.
> Would it be desirable to have Hibernate supply the values for these constants? Such as:
> @Pattern(type="email") or @Pattern(regex=org.hibernate.validator.Pattern.EMAIL) or @Email
> Email and URL are global patterns. This probably wouldn't work for something like phone number which is locale sensitive.
--
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
17 years, 5 months