[Hibernate-JIRA] Created: (BVTCK-11) Wrong usage of context classloader to discover resources in META-INF/services
by Hardy Ferentschik (JIRA)
Wrong usage of context classloader to discover resources in META-INF/services
-----------------------------------------------------------------------------
Key: BVTCK-11
URL: http://opensource.atlassian.com/projects/hibernate/browse/BVTCK-11
Project: Bean Validation TCK
Issue Type: Bug
Components: TCK Appeal
Affects Versions: 1.0.4.GA
Reporter: Hardy Ferentschik
Assignee: Emmanuel Bernard
*Problem Description*:
The test uses the context classloader to discover all META-INF/services/javax.validation.spi.ValidationProvider resources and checks whether one of the resource files contains the ValidationProvider currently under the test.
This method of checking for ValidationProvider might not work on all containers. Especially on containers with constrained classloaders (e.g. OSGi). The Bean Validation specification in section 4.4.4.1 talks about this exact problem. That's why the test should be using ValidationProviderResolver API to check for right provider instead of looking for the resource files.
*Tests affected*:
org.hibernate.jsr303.tck.tests.bootstrap.ValidationProviderResolverTest#testServiceFileExists()
--
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
11 years, 10 months
[Hibernate-JIRA] Created: (HHH-3238) impossible to get the rowcount for a criteria that has projections
by hbMailingList (JIRA)
impossible to get the rowcount for a criteria that has projections
------------------------------------------------------------------
Key: HHH-3238
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3238
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.6
Environment: hibernate 3.2.6, oracle 10g
Reporter: hbMailingList
Projections.rowCount correctly returns the NUMBER_OF_ROWS for the criteria's resultset.
However if the criteria already has a projection then rowcount no longer returns the NUMBER_OF_ROWS in the result set.
For example:
Criteria c=session.CreateCriteria(Cat.class);
ProjectionList pl = ...;
....
pl.add(Projections.groupProperty("color"));
pl.add(Projections.rowCount());
c.setProjections(pl);
c.list();
will result in the following query:
select color, count(*) from cats group by color
I would expect it to result in:
select count(*) from (select color from cats group by color)
after all if I wanted the count by color I could have simply done:
Projections.count(...)
I really need this feature for my project...if you don't think this will make the release, would you please give me a hint and I'll submit a patch.
Thanks for all the hard work.
--
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
11 years, 10 months
[Hibernate-JIRA] Created: (HHH-2218) java.util.ConcurrentModificationException at org.hibernate.pretty.Printer.toString(Printer.java:90)
by rm (JIRA)
java.util.ConcurrentModificationException at org.hibernate.pretty.Printer.toString(Printer.java:90)
---------------------------------------------------------------------------------------------------
Key: HHH-2218
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2218
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.1.3
Environment: Hibernate 3.1.3, spring 2.1.8 on Jboss 4.0.2 with Oracle 10g
Reporter: rm
Similar issues have been logged since May 2005 and have been marked as 'Fixed' by Gavin especially for Session.toString() related cases. However, I am also facing similar issues in Printer.toString()...
The saving grace is that when I set the debug level to INFO, the problem goes away...
Am copy/pasting the relevent stacktrace...I have also debugged this on eclipse and the exact location is the call to "new Printer(....)" in AbstractFlushingEventListener.java
java.util.ConcurrentModificationException
10:07:28,421 INFO [STDOUT] at java.util.HashMap$HashIterator.nextEntry(HashMap.java:787)
10:07:28,421 INFO [STDOUT] at java.util.HashMap$ValueIterator.next(HashMap.java:817)
10:07:28,421 INFO [STDOUT] at org.hibernate.pretty.Printer.toString(Printer.java:90)
10:07:28,421 INFO [STDOUT] at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:97)
10:07:28,421 INFO [STDOUT] at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:35)
10:07:28,421 INFO [STDOUT] at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:954)
10:07:28,421 INFO [STDOUT] at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1099)
10:07:28,421 INFO [STDOUT] at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
PS: This is my first attempt at logging issues at JIRA. Kindly point out any deficiencies or irregularities in this attempt.
--
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
11 years, 10 months
[Hibernate-JIRA] Created: (ANN-784) MapBinder.createFormulatedValue() does not honor DB schema name when creating query
by Sven Panko (JIRA)
MapBinder.createFormulatedValue() does not honor DB schema name when creating query
-----------------------------------------------------------------------------------
Key: ANN-784
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-784
Project: Hibernate Annotations
Issue Type: Bug
Components: binder
Affects Versions: 3.4.0.GA
Environment: Hibernate 3.3.0.SP1, PostgresQL 8.3
Reporter: Sven Panko
I detected a problem with a ManyToMany mapping using a Map in the following setup:
@Entity
@Table(name = "entitya", schema = "myschema")
class EntityA {
...
@ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@MapKey(name = "identifier")
@JoinTable(name = "entitya_entityb", schema="myschema", joinColumns = @JoinColumn(name = "entitya_pk"), inverseJoinColumns = @JoinColumn(name = "entityb_pk"))
@Cascade( { org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.DELETE_ORPHAN })
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
private Map<String, EntityB> entityBMap = new HashMap<String, EntityB>();
}
@Entity
@Table(name = "entityb", schema = "myschema")
class EntityB {
...
}
The SQL generated to load the entityBMap collection contains a subquery in the select clause, which looks like this:
select a8.identifier from entityb a8 where a8.pk=entityb0_.entityb_pk (entityb0_.entityb_pk comes from the outer select clause)
The problem here is, that entityb in the from clause is not prepended by the schema name "myschema" (the outer query is correctly doing this in the join clause, however). I tracked this down to the createFormulatedValue() method in the MapBinder class; the responsible code snippet is contained in lines 292 - 296:
StringBuilder fromAndWhereSb = new StringBuilder( " from " )
.append( associatedClass.getTable().getName() )
//.append(" as ") //Oracle doesn't support it in subqueries
.append( " " )
.append( alias ).append( " where " );
associatedClass.getTable().getName() does not return the fully qualified table name, so I think this should look something like this:
StringBuilder fromAndWhereSb = new StringBuilder( " from " );
if (associatedClass.getTable().getSchema() != null) {
fromAndWhereSb.append(associatedClass.getTable().getSchema()).append('.');
}
fromAndWhereSb.append( associatedClass.getTable().getName() )
//.append(" as ") //Oracle doesn't support it in subqueries
.append( " " )
.append( alias ).append( " where " );
--
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
11 years, 10 months
[Hibernate-JIRA] Created: (BVAL-225) JSR303 1.1: support resource bundles in constraint annotation packages
by Gabriele Del Prete (JIRA)
JSR303 1.1: support resource bundles in constraint annotation packages
----------------------------------------------------------------------
Key: BVAL-225
URL: http://opensource.atlassian.com/projects/hibernate/browse/BVAL-225
Project: Bean Validation
Issue Type: Improvement
Affects Versions: 1.1
Reporter: Gabriele Del Prete
Attachments: ResourceBundleMessageInterpolator.java
(I published this same proposal also on the forum, and copying it here so that it does not get lost)
This is a proposal for the new version of JSR 303 (v1.1 ?).
The proposal is: modify the default message interpolation algorithm (section 4.3.1.1) so that the validation engine looks for a Resource Bundle called "ValidationMessages" in the constraint annotation's own package.
For example, when validating constraint annotation com.gdpcons.constraints.MustEqual, validator should also look for messages in a resource bundle called com.gdpcons.constraints.ValidationMessages.
The constraint annotation package ValidationMessages resource bundle should be checked after the "user" ValidationMessages resource bundle, but before the BeanValidation provider's own private ValidationMessages resource bundle, so as to allow users to override the string provided by the constraint annotation resource bundle.
This would allow people to write redistributable collections of constraint annotations, since as of today it's not possible to use multiple ValidationMessages resource bundles files (one will override all the others in the classpath); and it would still allow users to override the provided messages just by a new definition for the message key in their own ValidationMessages resource bundle.
I've written an example implementation, by modifying Hibernate Validator's own ResourceBundleMessageInterpolator. It seams to work without side effects, and is a very straightforward implementation.
See it attached to this issue.
--
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
11 years, 10 months
[Hibernate-JIRA] Created: (BVAL-211) Consider making javax.validation.ValidatorContext a self-referential generic type
by Gunnar Morling (JIRA)
Consider making javax.validation.ValidatorContext a self-referential generic type
---------------------------------------------------------------------------------
Key: BVAL-211
URL: http://opensource.atlassian.com/projects/hibernate/browse/BVAL-211
Project: Bean Validation
Issue Type: Improvement
Components: spec-general
Affects Versions: 1.0 final
Reporter: Gunnar Morling
Priority: Minor
It should be investigated whether the interface javax.validation.ValidatorContext could be re-defined as self-referential generic type as follows:
{code:java}
public interface ValidatorContext <V extends ValidatorContext<V>> {
V messageInterpolator(MessageInterpolator messageInterpolator);
V traversableResolver(TraversableResolver traversableResolver);
V constraintValidatorFactory(ConstraintValidatorFactory factory);
Validator getValidator();
}
{code}
Provider-specific extensions of this interface (such as [HibernateValidatorContext|https://github.com/hibernate/hibernate-validato...]) then wouldn't have to re-define all of ValidatorContext's methods returning their own type (which they currently must do in order to allow for the method chaining pattern to work correctly).
Generally this is a breaking change, as existing implementations wouldn't compile with the proposed new version of the interface. But as it is intended to be implemented by BV providers only, this seems acceptable. API users would get a raw type warning if they have variables of type ValidatorContext. This should happen very rarely though, as ValidatorContext typically is only used in chained method calls (with a final getValidator() invocation) but not assigned to a variable.
--
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
11 years, 10 months