[Hibernate-JIRA] Created: (HHH-7184) Missing StaticModels for envers revision entity
by Sylvain Vieujot (JIRA)
Missing StaticModels for envers revision entity
-----------------------------------------------
Key: HHH-7184
URL: https://hibernate.onjira.com/browse/HHH-7184
Project: Hibernate ORM
Issue Type: Bug
Components: envers
Affects Versions: 4.1.1
Reporter: Sylvain Vieujot
When you create a custom Envers RevisionEntity, the Java Annotation processing generates a @StaticMetamodel extending hibernates static model for the DefaultRevisionEntity, but this class is not packaged in envers'jar file :
@StaticMetamodel(CustomRevisionEntity.class)
public abstract class CustomRevisionEntity_ extends org.hibernate.envers.DefaultRevisionEntity_ {
public static volatile SingularAttribute<CustomRevisionEntity, String> ipAddress;
}
The compiler generates :
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project intranet: Compilation failure: Compilation failure:
[ERROR] Hibernate JPA 2 Static-Metamodel Generator 1.1.1.Final
[ERROR] /home/sylvain/My/Progs/Java/REIT.intranet/target/generated-sources/annotations/ae/reit/intranet/persistence/CustomRevisionEntity_.java:[7,72] error: cannot find symbol
[ERROR] package org.hibernate.envers
[ERROR] /home/sylvain/My/Progs/Java/REIT.intranet/target/generated-sources/annotations/ae/reit/intranet/persistence/CustomRevisionEntity_.java:[7,72] error: cannot find symbol
as it can not fild : org.hibernate.envers.DefaultRevisionEntity_
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years
[Hibernate-JIRA] Created: (JPA-30) jpa
by xavier flamant (JIRA)
jpa
----
Key: JPA-30
URL: https://hibernate.onjira.com/browse/JPA-30
Project: Java Persistence API
Issue Type: Story
Affects Versions: 1.0.0
Reporter: xavier flamant
Hi,
I posted this issue on hibernate forum and had no satisfying answer. I post it on jira because the hibernate log for the request doesn't seem to fit the original request. It may be a bug
The complete query QUERY1 is
query = "SELECT a " +
"FROM eu.eclinica.cdisc.odm.ODMAnnotation a " +
"WHERE ([color=#FF8000](a.subjectData.clinicalData.study.oID = 1069 and a.seqNum = 1)[/color] or [color=#0040FF](a.studyEventData.subjectData.clinicalData.study.oID = 1069 and a.seqNum = 1)[/color])"
it gives me 0 result
The query QUERY2 with the first subQuery is
query = "SELECT a " +
"FROM eu.eclinica.cdisc.odm.ODMAnnotation a " +
"WHERE ([color=#FF8000](a.subjectData.clinicalData.study.oID = 1069 and a.seqNum = 1)[/color] "
it gives me 1 result Result1
The query QUERY3 with the second subQuery is
query = "SELECT a " +
"FROM eu.eclinica.cdisc.odm.ODMAnnotation a " +
"WHERE [color=#0040FF](a.studyEventData.subjectData.clinicalData.study.oID = 1069 and a.seqNum = 1)[/color]"
it gives me 1 other result Result2
the problem is that the first query QUERY1 should give me 2 results (the result of QUERY2 PLUS the result of QUERY3) as there is a OR clause
I debuged the real request made on the database
[code]
2012-03-08 14:11:37 SQL [DEBUG] select odmannotat0_.oID as oID7_, odmannotat0_.ID as ID7_, odmannotat0_.COMMENTID as COMMENTID7_, odmannotat0_.ANNOTATION_CREDT as ANNOTATION3_7_, odmannotat0_.ANNOTATION_DUEDT as ANNOTATION4_7_, odmannotat0_.FORMDATAID as FORMDATAID7_, odmannotat0_.ITEMDATAID as ITEMDATAID7_, odmannotat0_.ITEMGROUPDATAID as ITEMGRO10_7_, odmannotat0_.SEQNUM as SEQNUM7_, odmannotat0_.EVENTDATAID as EVENTDA11_7_, odmannotat0_.SUBJECTDATAID as SUBJECT12_7_, odmannotat0_.TRANSACTIONTYPE as TRANSACT6_7_ from Annotation odmannotat0_, SubjectData odmsubject1_, ClinicalData odmclinica2_, StudyEventData odmstudyev3_, SubjectData odmsubject4_, ClinicalData odmclinica5_ where odmannotat0_.SUBJECTDATAID=odmsubject1_.oID and odmsubject1_.CLINICALDATAID=odmclinica2_.oID and odmannotat0_.EVENTDATAID=odmstudyev3_.oID and odmstudyev3_.SUBJECTDATAID=odmsubject4_.oID and odmsubject4_.CLINICALDATAID=odmclinica5_.oID and (odmclinica2_.STUDYID=? and odmannotat0_.SEQNUM=1 or odmclinica5_.STUDYID=? and odmannotat0_.SEQNUM=1)
[/code]
To summarize, the request made on the database is the following (I use there my proper coding)
query = "SELECT a " +
"FROM eu.eclinica.cdisc.odm.ODMAnnotation a " +
"WHERE [color=#FF8000]a.subjectData.clinicalData c1[/color] AND [color=#0040FF]a.studyEventData.subjectData.clinicalData c2[/color] and (c1.study.oID = 1069 and a.seqNum = 1or c2.study.oID = 1069 and a.seqNum = 1)"
I really don't see why the first part is "a.subjectData.clinicalData c1 AND a.studyEventData.subjectData.clinicalData c2"
as these two clause should be used with an "OR". Obviously, seeing the request that is sent to the database it is normal that there is no Results
So what is wrong with the QUERY1 ?
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years
[Hibernate-JIRA] Commented: (HHH-1109) composite-key does not support null-values
by Piotr Jagielski (JIRA)
[ https://hibernate.onjira.com/browse/HHH-1109?page=com.atlassian.jira.plug... ]
Piotr Jagielski commented on HHH-1109:
--------------------------------------
I have exactly the same situation as in description - a db-view, which combines two tables by outer-join. In my case the only unique combination of columns contains a nullable column. I don't need primary key but Hibernate forces me to define one. Since this request is rejected then what is the correct way to handle such situation in Hibernate?
> composite-key does not support null-values
> ------------------------------------------
>
> Key: HHH-1109
> URL: https://hibernate.onjira.com/browse/HHH-1109
> Project: Hibernate ORM
> Issue Type: Bug
> Affects Versions: 3.0.5
> Environment: [org.hibernate.type.EmbeddedComponentType.hydrate(...)#425]
> Reporter: Holger Bartnick
> Attachments: componentType-fix-nullkey-compositekey.patch, NullableStringType.java
>
> Original Estimate: 8h
> Remaining Estimate: 8h
>
> At present all legacy data with null-values in its composite-key could not be read properly by hibernate.
> While hibernate processes the resultset it returns null for that record and steps over to the next one.
> Think of a db-view, which combines two (or more) tables by outer-join.
> (that seems only necessary for crude legacy data indeed... but it´s not that unusual as you think)
> The workaround is to use a db-generated identifier for each view-record (ex. combining the nullable-id fields).
> It would be fine, if hibernate is not reliant on that. ;-)
> To allow having composite-keys with partly null-Values, you could think of moving the "unsaved-value"-attribute
> of the "composite-key"-tag to "key-property|key-many-to-one"-Tags...?!
> ---
> Mmmh... saw you´ve done something with "columnNullness" in ver 3.1beta2. Perhaps it is fixed in there...
> also seen on HB-613
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years
[Hibernate-JIRA] Created: (HHH-7181) Mixing inheritance strategy in a entity hierarchy is not allowed message for JOINED + SINGLE_TABLE
by Pim van Dongen (JIRA)
Mixing inheritance strategy in a entity hierarchy is not allowed message for JOINED + SINGLE_TABLE
--------------------------------------------------------------------------------------------------
Key: HHH-7181
URL: https://hibernate.onjira.com/browse/HHH-7181
Project: Hibernate ORM
Issue Type: New Feature
Components: metamodel
Affects Versions: 4.0.0.CR5
Environment: Hibernate 4.0.0.CR5 (annotations 4.0.0.CR2), HSQLDB 2.2.6
Reporter: Pim van Dongen
Priority: Minor
Attachments: JSTNoWarning.txt
When mixing inheritance strategies in a single entity hierarchy like the following:
A with @Inheritance(strategy=InheritanceType.SINGLE_TABLE)
B extends A
C extends A with @Inheritance(strategy=InheritanceType.JOINED)
D extends C
E extends C
The following warning is given by Hibernate:
WARN: HHH000138: Mixing inheritance strategy in a entity hierarchy is not allowed, ignoring sub strategy in: com.example.C
However, when I reverse this,
A with @Inheritance(strategy=InheritanceType.JOINED)
B extends A
C extends A with @Inheritance(strategy=InheritanceType.SINGLE_TABLE)
D extends C
E extends C
Hibernate does NOT give me a warning. Looking at the database reveals that the tables A, B, C, D and E are made (where only A, B and C should have been created).
"Feature" request: Please give a warning when encountering a mixed inheritance strategy that is not supported by Hibernate, such as JOINED + SINGLE_TABLE.
I've attached some files (one file listing all teh codez) that I used when encountering the issue, namely the classes A through E, and some testing code.
I did not provide a testcase because I don't know of an exact testcase that could be used to reproduce the issue that it doesn't make the tables properly AND doesn't display a warning.
I did provide a method which you can run through debug, during which you can examine the database or logs to see that the tables haven't been made properly. Combine it with console output, and there you go.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years
[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
14 years
[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
14 years