QueryExpressions.containsAll not working properly
-------------------------------------------------
Key: QI-242
URL: http://issues.ops4j.org/browse/QI-242
Project: Qi4j
Issue Type: Bug
Components: API, Query
Affects Versions: 1.0
Environment: Any environment, which has a proper values for
JdbmEntityStoreService and rdf-indexing -services in preference ES for default
Application.
Reporter: Stanislav Muhametsin
Assignee: Rickard Öberg
Attachments: ContainsAllTest.java
When querying for entity and using
QueryExpressions.containsAll(Property<Collection<T>>, Collection<T>) method,
there are two problems:
* One must cast the Property into non-generic type, like this:
{code}
QueryExpressions.containsAll(
(Property) QueryExpressions.templateFor(ExampleEntity.class).strings(),
...);
{code}
, where ExampleEntity is
{code}
public interface ExampleEntity extends EntityComposite
{
Property<Set<String>> strings();
}
{code}
The possible solution to this would be changing method signature of containsAll
method (and possibly some others too) into
{code}
public static <T, C extends Collection<T>> ContainsAllPredicate<T> containsAll(
Property<C> property, C value )
{code}
* The query itself fails to execute due to an exception:
{noformat}
org.qi4j.api.query.QueryExpressionException: Unsupported property
type:java.util.Set<java.lang.String>
at
org.qi4j.runtime.query.grammar.impl.PropertyReferenceImpl.<init>(PropertyReferenceImpl.java:95)
at
org.qi4j.runtime.query.proxy.PropertyReferenceProxy.<init>(PropertyReferenceProxy.java:51)
at
org.qi4j.runtime.query.proxy.MixinTypeProxy.invoke(MixinTypeProxy.java:129)
at $Proxy40.strings(Unknown Source)
{noformat}
The full test is included as an attachment.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.ops4j.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev