[Hibernate-JIRA] Created: (ANN-506) Request for Expression Language (EL) for Validator annotations
by Chris Hansen (JIRA)
Request for Expression Language (EL) for Validator annotations
--------------------------------------------------------------
Key: ANN-506
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-506
Project: Hibernate Annotations
Type: New Feature
Components: validator
Environment: All
Reporter: Chris Hansen
Since annotations are limited to primitive types, I would like to see a type of EL for the Validator annotations (similar to the JSF/JSP EL). This would effectively overcome this limitation of annotations and allow for very powerful functionality, such as utilizing the natural ordering of classes. For example:
@Range(min="#{MyClass.MIN_OBJECT}", max="#{MyClass.MAX_OBJECT}") public MyClass getCurrent()
Assuming MIN_OBJECT and MAX_OBJECT are (static, final) instances of MyClass and MyClass implements Comparable<myClass>, the validator could compare the return value of the method with both MIN_OBJECT and MAX_OBJECT and validate that it is within the desired range.
This is just an example. I'm sure there are many more interesting uses possible because this is a powerful concept.
The regular functionality of the annotatinos could be preserved by treating static (non-EL) values, such as the string "0", as old-style primitives, e.g. @Min(value="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
17 years, 5 months
[Hibernate-JIRA] Updated: (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 updated HV-19:
---------------------------------
Component/s: validators
> 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
> 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] Created: (ANN-619) Problem with @OneToOne relation in composite key
by Artur Legan (JIRA)
Problem with @OneToOne relation in composite key
------------------------------------------------
Key: ANN-619
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-619
Project: Hibernate Annotations
Issue Type: Bug
Affects Versions: 3.3.0.ga
Environment: PostgreSQL 8
Reporter: Artur Legan
Attachments: jira.zip
I got:
[java] Exception in thread "main" java.lang.ExceptionInInitializerError
[java] at util.HibernateUtil.<clinit>(Unknown Source)
[java] at one.Start.main(Unknown Source)
[java] Caused by: java.lang.NullPointerException
[java] at org.hibernate.cfg.AnnotationBinder.bindOneToOne(AnnotationBinder.java:1960)
[java] at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1346)
[java] at org.hibernate.cfg.AnnotationBinder.fillComponent(AnnotationBinder.java:1731)
[java] at org.hibernate.cfg.AnnotationBinder.bindId(AnnotationBinder.java:1768)
[java] at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1229)
[java] at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:733)
[java] at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:498)
[java] at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:277)
[java] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1286)
[java] at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
[java] ... 2 more
when I tried to run application where i have @OneToOne in composite key (@ManyToOne worked fine)
I made this code as short as I could, just put path to jars in build.xml and to database in hibernate.cfg.xml if you want to check it
If I upload to much or to few just let me know, couse it's first time i'm adding stuff here
I'm posting it because emmanuel told me to do it :)
--
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