[Hibernate-JIRA] Commented: (HV-21) Base class validations are not over-ridden
by gilad bar orion (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HV-21?page=com.... ]
gilad bar orion commented on HV-21:
-----------------------------------
I'm basically in the same position as Natalia, this limitation greatly restrict the usability of HV. Hope it's fixed soon!
> Base class validations are not over-ridden
> ------------------------------------------
>
> Key: HV-21
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-21
> Project: Hibernate Validator
> Issue Type: Improvement
> Components: engine
> Environment: hibernate 3.2 cr2
> Reporter: Aseel Abbas
>
> When the same validation annotation is applied to an over-riding method in a subclass the expected behaviour is that the validation annotation in the base class is over-ridden. Currently, both validations are executed. This severely limits the usability of the package for domain models where inheritance is used.
> The problem also occurs with over-riding interfaces.
> For example:
> class A {
> @Length (min = 0, max = 32)
> Integer getFoo() {
> return foo;
> }
> }
> class B extends A
> {
> @Length (min = 15, max = 20)
> Integer getFoo() {
> return super.getFoo();
> }
> }
> In this case validating an instance of class B which has a foo value of 100 will result in two error messages: "foo must be between 15 and 20" and "foo must be between 0 and 32".
--
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
16 years, 11 months
[Hibernate-JIRA] Created: (EJB-399) Collecitons in Associated Objects should never be null per EJB 3.0 Specification 2.1.7 Entity Relationships
by Jon Kofal (JIRA)
Collecitons in Associated Objects should never be null per EJB 3.0 Specification 2.1.7 Entity Relationships
-----------------------------------------------------------------------------------------------------------
Key: EJB-399
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-399
Project: Hibernate Entity Manager
Issue Type: Bug
Components: EntityManager
Affects Versions: 3.3.1.GA
Environment: Windows XP, JRE 1.6.0_07
Reporter: Jon Kofal
"EJB 3.0 Specification 2.1.7 Entity Relationships" says (last paragraph):
"If there are no associated entities for a multi-valued relationship of an entity fetched from the database,
the persistence provider is responsible for returning an empty collection as the value of the relationship."
This code below throws a NullPointerException, because the Collection returned from "p.getReports()" is null. I'd expect that p.getReports() wold return an empty Collection per the EJB 3.0 Specification.
public void testProjectReport() throws Exception {
EntityManager em = null;
try {
em = emf.createEntityManager();
em.getTransaction().begin();
Projekt p = new Projekt();
p.setName(PROJEKT[0]);
em.persist(p);
p = (Projekt) em.createQuery("from Projekt").getSingleResult();
for (Iterator<Report> i = p.getReports().iterator(); i.hasNext();) {
logger.info(i.next().toString());
}
em.getTransaction().commit();
} catch (Exception e) {
logger.log(Level.SEVERE, e.getMessage(), e);
throw e;
} finally {
if (em != null) {
em.close();
}
}
}
--
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
16 years, 11 months
[Hibernate-JIRA] Created: (EJB-398) identity error, when insert statement is created
by P G (JIRA)
identity error, when insert statement is created
------------------------------------------------
Key: EJB-398
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-398
Project: Hibernate Entity Manager
Issue Type: Bug
Components: EntityManager
Affects Versions: 3.3.1.GA
Environment: MS SQL Server
Reporter: P G
Priority: Blocker
When hibernate generates insert for table with identity, it adds to insert statement a field with identity primary key.
A entity has enabled auto generation type and MS SQL Dialect set for this type identity generation.
I see created changes which could break proper generation in:AbstractEntityPersister.postConstruct(...).
The 3.2.1.GA version has: sqlIdentityInsertString = generateIdentityInsertString( getPropertyInsertability() );
The 3.3.1.GA version has: sqlIdentityInsertString = sqlInsertStrings[0] == null ? generateIdentityInsertString( getPropertyInsertability() ) : sqlInsertStrings[0];
In all mentioned versions, sqlInsertStrings is generation in the same way.
--
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
16 years, 11 months