FWIW,
I tested with the following code;
private void addProperties( Map<Type, ValueType> typeMap, Class
valueTypeClass, Class compositeType, List<PropertyType> types )
{
for( Method method : valueTypeClass.getDeclaredMethods() )
{
Type propType = GenericPropertyInfo.getPropertyType( method );
if( propType != null )
{
Queryable queryableAnnotation = method.getAnnotation(
Queryable.class );
And that at least solves Lukasz issue found. Will see if any other
problem arises from it...
Cheers
Niclas
On Fri, Oct 2, 2009 at 5:20 PM, Niclas Hedhman <[email protected]> wrote:
> Rickard,
>
> this problem resides in ValueTypeFactory.addProperties() and the statement;
>
> if( returnType instanceof ParameterizedType && ( (ParameterizedType)
> returnType ).getRawType().equals( Property.class ) )
>
> I suspect that the .equals() should be an
> Property.class.isAssignableFrom() instead. Please confirm...
>
> Also, how come this check is so complex, compared to the
> PropertyMixin.PropertyFilter, which doesn't bother with the
> ParameterizedType... IMHO, we should probably centralize the probe of
> determining the method being a property or not.
>
> Cheers
>
> 2009/10/2 Łukasz Zieliński <[email protected]>:
>> Hello,
>> It looks like ValueComposite properties are not always serialized. I define
>> an entity with value property of type Foo, now this value in turn has two
>> properties:
>> interface Foo {
>> Property<String> bar();
>> BazProperty baz();
>> }
>> interface BazProperty extends Property<String> {}
>> When entity is created and after UnitOfWork.apply() is called serialize for
>> looks like this (edited to focus on properties):
>> "properties":{
>> "identity":"9c70bea0-3ea8-4d56-98c0-e508c2cdc2ab-0",
>> "foo":{"bar":"Bar"}
>> },
>> Baz got lost somewhere along the way :). I first encountered this when using
>> Jdbm ES however snippet above was extracted from MemoryEntityStoreService
>> instance.
>> Now I'm leaning towards position that using such properties in
>> ValueComposite context might be an overkill but this issue arose when I was
>> following
>> "HowTo: Create an Entity" (the Accident interface) so I'd like to know what
>> is your opinion on this matter.
>> Attached is a simple test app.
>> Cheers,
>> Lukasz
>> _______________________________________________
>> qi4j-dev mailing list
>> [email protected]
>> http://lists.ops4j.org/mailman/listinfo/qi4j-dev
>>
>>
>
>
>
> --
> Niclas Hedhman, Software Developer
> http://www.qi4j.org - New Energy for Java
>
> I live here; http://tinyurl.com/2qq9er
> I work here; http://tinyurl.com/2ymelc
> I relax here; http://tinyurl.com/2cgsug
>
--
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java
I live here; http://tinyurl.com/2qq9er
I work here; http://tinyurl.com/2ymelc
I relax here; http://tinyurl.com/2cgsug
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev