[Hibernate-JIRA] Created: (HHH-2085) org.hibernate.event.def.DefaultLoadEventListener logs exception at info level
by Don Smith (JIRA)
org.hibernate.event.def.DefaultLoadEventListener logs exception at info level
-----------------------------------------------------------------------------
Key: HHH-2085
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2085
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.0.cr2
Environment: Hibernate 3.2.0.cr2, MySQL 4.0.18
Reporter: Don Smith
Priority: Minor
Prior to schema generation, accessing a persistent object throws an exception, as expected. The org.hibernate.event.def.DefaultLoadEventListener logs the exception at the info level, which just adds noise to the application console, and prevents application exception handling (in my case it's valid if the table doesn't exist, so I just want to catch the exception and continue). This log statement should be removed, or moved to a debug or trace level, so it won't show up in normal execution.
Code, from line 94 of org.hibernate.event.def.DefaultLoadEventListener:
catch(HibernateException e) {
log.info("Error performing load command", e);
throw e;
}
--
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
12 years, 9 months
[Hibernate-JIRA] Created: (EJB-361) Query#setParameter(int position, Object value) wrong implementation
by Fabrice Daugan (JIRA)
Query#setParameter(int position, Object value) wrong implementation
-------------------------------------------------------------------
Key: EJB-361
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-361
Project: Hibernate Entity Manager
Issue Type: Bug
Components: EntityManager
Affects Versions: 3.3.2.GA
Reporter: Fabrice Daugan
The Hibernate JPA javax.persistence.Query#setParameter(int position, Object value) implementation does not suit to the JPA specicafication.
Indeed, the actual integer passed to the operation is converted to String by Hibernate and then used to find the named parameter.
Please have a look to the folowing stack trace :
java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IllegalArgumentException:
org.hibernate.QueryParameterException: could not locate named parameter [1]
at org.hibernate.ejb.QueryImpl.setParameter(QueryImpl.java:185)
at org.hibernate.ejb.QueryImpl.setParameter(QueryImpl.java:240)
at org.springframework.orm.jpa.JpaTemplate$9.doInJpa(JpaTemplate.java:316)
To repoduce this error :
--
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
12 years, 9 months
[Hibernate-JIRA] Created: (HV-264) Validation of List of primitives
by Michenaud Laurent (JIRA)
Validation of List of primitives
--------------------------------
Key: HV-264
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-264
Project: Hibernate Validator
Issue Type: Bug
Components: engine
Affects Versions: 4.0.1
Environment: Linux
Reporter: Michenaud Laurent
Hi,
I have a list of String in my bean :
These strings are email and i want to validate them.
So, i did in my bean :
@NotEmpty
@Email
//@Valid <= uncommenting that line doesnot change anything.
List<String> emails ;
At execution, i've got the error :
Exception in thread "main" javax.validation.UnexpectedTypeException: No validator could be found for type: java.util.List<java.lang.String>
at org.hibernate.validator.engine.ConstraintTree.verifyResolveWasUnique(ConstraintTree.java:236)
at org.hibernate.validator.engine.ConstraintTree.findMatchingValidatorClass(ConstraintTree.java:219)
at org.hibernate.validator.engine.ConstraintTree.getInitializedValidator(ConstraintTree.java:167)
at org.hibernate.validator.engine.ConstraintTree.validateConstraints(ConstraintTree.java:113)
at org.hibernate.validator.metadata.MetaConstraint.validateConstraint(MetaConstraint.java:121)
at org.hibernate.validator.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:334)
at org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForRedefinedDefaultGroup(ValidatorImpl.java:278)
at org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:260)
at org.hibernate.validator.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:213)
at org.hibernate.validator.engine.ValidatorImpl.validate(ValidatorImpl.java:119)
at com.adeuza.movalys.validation.hibernate.TestMain.main(TestMain.java:75)
I don't know if it is a bug in hibernate validator. I have looked at the JSR303 and i have not seen anything
about List of primitives. You can validate per example List<Person> with @Valid and it works well because
the validator knows about Person class.
I have used a little the Oval framework and with it, you can tell if the check applies to the container,
or the values inside, or the keys(for map). I don't know if you can do that with JSR303.
I'm interesting with your point of view.
--
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
12 years, 9 months
[Hibernate-JIRA] Created: (HV-135) Constraints can contains constraint annotations to validate params before initialize is called
by Emmanuel Bernard (JIRA)
Constraints can contains constraint annotations to validate params before initialize is called
----------------------------------------------------------------------------------------------
Key: HV-135
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-135
Project: Hibernate Validator
Issue Type: New Feature
Components: engine
Reporter: Emmanuel Bernard
not high priority
>From Sebastian Thomschke
--------------------------------------
I just had a look through the Hibernate Validator code, what struck me
was the way how you validate parameters. E.g.
private void validateParameters() {
if ( min < 0 ) {
throw new ValidationException( "The min parameter cannot be
negative." );
}
if ( max < 0 ) {
throw new ValidationException( "The max paramter cannot be
negative." );
}
if ( max < min ) {
throw new ValidationException( "The length cannot be
negative." );
}
}
I just had the idea, why don't we use the constraint annotations for the
built-in constraints themselves? E.g.
/**
* @return size the element must be higher or equal to
*/
@Min(0)
int min() default 0;
/**
* @return size the element must be lower or equal to
*/
@Min(0)
int max() default Integer.MAX_VALUE;
Then this kind of parameter validation could be done by the framework
and must not be repeated in every validator implementation.
What do you think?
Regards,
Seb
--------------------------------------
Emmanuel
Your idea is interesting. It could lead to infinite recursion if someone does not pay attention but could work.
I think it would better be a product feature though instead of a spec feature for this rev at least. We can't have "class" level constraints though as it conflicts with the composition model.
WDYT?
it seems to me that the ValidationException is wrong in the example you gave.
http://opensource.atlassian.com/projects/hibernate/browse/HV-134
--
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
12 years, 9 months