[Hibernate-JIRA] Created: (HHH-4453) Reserved keywords not quoted in table/column names
by Philipp Reichart (JIRA)
Reserved keywords not quoted in table/column names
--------------------------------------------------
Key: HHH-4453
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4453
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.1
Environment: Hibernate 3.3.1 GA, Windows XP, Sun JDK 1.6.0_06, Derby 10.5
Reporter: Philipp Reichart
I'm currently migrating our test suite form HSQLDB to Derby (we need transaction isolation and the HSLDB 1.9 RCs are no good), and found out that we have a lot of table or colum names that happen to be reserved keywords in Derby, like "transaction", "key", "value", "year", etc..
The usual workaround seems to be adding backticks to any offending table/column name in our hbm.xml files, but that's really an ugly workaround and doesn't prevent later incidents of this kind when new keywords show up in either our mappings or database. As this is about a production database schema, reanming the table/column names isn't an option either.
I already tried implementing a custom Derby dialect and registering all the keywords from the Derby doc at http://db.apache.org/derby/docs/10.5/ref/rrefkeywords29722.html and even defined a "quote everything" NamingStrategy using the dialect to get the correct native quotes for the database.
Unfortunately, neither the Hibernate DDL generator nor HQL queries seem to consider the naming strategy or dialect when handling table or column names.
Is there any way to have Hibernate quote database-specific keywords every they're used?
Or just have Hibernate quote everything that comes from a mapping 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
13 years, 7 months
[Hibernate-JIRA] Created: (HV-353) Support inheritance for marker interfaces
by Marc Schipperheyn (JIRA)
Support inheritance for marker interfaces
-----------------------------------------
Key: HV-353
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-353
Project: Hibernate Validator
Issue Type: Improvement
Components: annotation-processor
Affects Versions: 4.1.0.Final
Reporter: Marc Schipperheyn
Assignee: Hardy Ferentschik
Currently, constraints use marker interface specified in the group attribute to determine whether a constraint is active for a certain context.
Unfortunately, group membership doesn't seem to support inheritance which would greatly reduce the number of markers required (and processing since you need less markers).
E.g. (contrived)
public interface CheckVehicle{}
public interface CheckCar extends CheckVehicle{}
public interface CheckBicycle extends CheckVehicle{}
//bean
@AssertTrue(groups={CheckVehicle.class})
Boolean workingBrakes()
@NotNull(groups={CheckBicycle.class})
String brakeType()
If the active group is CheckBicycle, it should validate both workingBrakes and brakeType.
It should be a relatively simply change as well.
--
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
13 years, 7 months
[Hibernate-JIRA] Created: (HV-374) NoSuchMethodError on Persistence.getPersistenceUtil() on WebLogic 10.3.3 (11g)
by Vitaly Polonetsky (JIRA)
NoSuchMethodError on Persistence.getPersistenceUtil() on WebLogic 10.3.3 (11g)
------------------------------------------------------------------------------
Key: HV-374
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-374
Project: Hibernate Validator
Issue Type: Bug
Affects Versions: 4.1.0.Final
Environment: WebLogic 10.3.3 (11g)
Reporter: Vitaly Polonetsky
Assignee: Hardy Ferentschik
The latest WebLogic comes with hybrid configuration of JPA 1.0 with some features of JPA 2.0:
https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=FAQ...
This causes a problem with the way Hibernate Validator checks for existence of JPA 2.0:
org.hibernate.validator.engine.resolver.DefaultTraversableResolver.detectJPA() checks for existance of javax.persistence.PersistenceUtil class (which exists only in JPA 2.0), but org.hibernate.validator.engine.resolver.JPATraversableResolver will not use it directly, instead it will use javax.persistence.Persistence.getPersistenceUtil() (the class exists for JPA 1.0, but the method is available only at JPA 2.0).
This check is good for situations where either full JPA 1.0 or full 2.0 implementation is available, but is cases like we have in WebLogic it leads to an Error:
java.lang.NoSuchMethodError: javax.persistence.Persistence.getPersistenceUtil()Ljavax/persistence/PersistenceUtil;
at org.hibernate.validator.engine.resolver.JPATraversableResolver.isReachable(JPATraversableResolver.java:62)
at org.hibernate.validator.engine.resolver.DefaultTraversableResolver.isReachable(DefaultTraversableResolver.java:94)
at org.hibernate.validator.engine.resolver.SingleThreadCachedTraversableResolver.isReachable(SingleThreadCachedTraversableResolver.java:47)
at org.hibernate.validator.engine.ValidatorImpl.isValidationRequired(ValidatorImpl.java:757)
at org.hibernate.validator.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:324)
at org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForRedefinedDefaultGroup(ValidatorImpl.java:273)
at org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:256)
at org.hibernate.validator.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:210)
at org.hibernate.validator.engine.ValidatorImpl.validate(ValidatorImpl.java:119)
...
I would suggest a possible way to overcome this situation in Hibernate Validator:
To check for existence of JPA 2.0, check the existence of Persistence.getPersistenceUtil() method, instead of checking for the existence of PersistenceUtil class. This will disable the use of JPA 2.0 features inside HV when the method is not available.
--
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
13 years, 7 months