Package org.qi4j.api.property

Examples of org.qi4j.api.property.PropertyDescriptor


        {
            // New EntityState
            EntityState entityState = store.newEntityState( identity, this );

            // Set identity property
            PropertyDescriptor persistentPropertyDescriptor = state().getProperty( IDENTITY_METHOD );
            entityState.setProperty( persistentPropertyDescriptor.qualifiedName(), identity.identity() );

            return entityState;
        }
        catch( EntityAlreadyExistsException e )
        {
View Full Code Here


            else
            {
                name = annotation.value();
            }

            PropertyDescriptor propertyDescriptor = descriptor.getPropertyByName( name );

            // Check if property exists
            if( propertyDescriptor == null )
            {
                return null;
View Full Code Here

                return null;
            }
            else
            {
                Module module = unitOfWork.module();
                PropertyDescriptor descriptor = entityDescriptor.state().getPropertyByQualifiedName( stateName );

                if (descriptor == null)
                    return null;

                JSONDeserializer deserializer = new JSONDeserializer( module );

                return deserializer.deserialize( json, descriptor.valueType() );
            }
        }
        catch( JSONException e )
        {
            throw new EntityStoreException( e );
View Full Code Here

            {
                jsonValue = JSONObject.NULL;
            }
            else
            {
                PropertyDescriptor persistentPropertyDescriptor = entityDescriptor.state()
                    .getPropertyByQualifiedName( stateName );

                JSONObjectSerializer serializer = new JSONObjectSerializer();
                serializer.serialize( newValue, persistentPropertyDescriptor.valueType() );
                jsonValue = serializer.getRoot();
            }
            cloneStateIfGlobalStateLoaded();
            state.getJSONObject( JSON_KEY_PROPERTIES ).put( stateName.name(), jsonValue );
            markUpdated();
View Full Code Here

                    @Override
                    public Object map( PropertyDescriptor descriptor )
                    {
                        try
                        {
                            PropertyDescriptor propertyDescriptor = entityDescriptor.state()
                                .findPropertyModelByName( descriptor.qualifiedName().name() );
                            return associationState.propertyFor( propertyDescriptor.accessor() ).get();
                        }
                        catch( IllegalArgumentException e )
                        {
                            if( descriptor.valueType().mainType().equals( String.class ) )
                            {
View Full Code Here

            else
            {
                name = annotation.value();
            }

            PropertyDescriptor propertyDescriptor = descriptor.findPropertyModelByName( name );
            return new PropertyInjectionProvider( propertyDescriptor );
        }
        else if( Association.class.isAssignableFrom( dependencyModel.rawInjectionType() ) )
        {
            // @State Association<MyEntity> name;
View Full Code Here

        {
            // New EntityState
            EntityState entityState = store.newEntityState( identity, this );

            // Set identity property
            PropertyDescriptor persistentPropertyDescriptor = state().propertyModelFor( IDENTITY_METHOD );
            entityState.setPropertyValue( persistentPropertyDescriptor.qualifiedName(), identity.identity() );

            return entityState;
        }
        catch( EntityAlreadyExistsException e )
        {
View Full Code Here

                    @Override
                    public Object map( PropertyDescriptor descriptor )
                    {
                        try
                        {
                            PropertyDescriptor propertyDescriptor = entityDescriptor.state()
                                .findPropertyModelByName( descriptor.qualifiedName().name() );
                            return associationState.propertyFor( propertyDescriptor.accessor() ).get();
                        }
                        catch( IllegalArgumentException e )
                        {
                            if( descriptor.valueType().mainType().equals( String.class ) )
                            {
View Full Code Here

    @Override
    public Object propertyValueOf( QualifiedName stateName )
    {
        try
        {
            PropertyDescriptor persistentProperty = entityDescriptor().state().findPropertyModelByQualifiedName( stateName );
            Object prop = underlyingNode.getProperty( "prop::" + stateName.toString(), null );
            if( prop == null )
            {
                return null;
            }
            else if( ValueType.isPrimitiveValueType( persistentProperty.valueType() ) )
            {
                return prop;
            }
            else
            {
                return valueSerialization.deserialize( persistentProperty.valueType(), prop.toString() );
            }
        }
        catch( ValueSerializationException e )
        {
            throw new EntityStoreException( e );
View Full Code Here

    {
        try
        {
            if( prop != null )
            {
                PropertyDescriptor persistentProperty = entityDescriptor().state().findPropertyModelByQualifiedName( stateName );
                if( ValueType.isPrimitiveValueType( persistentProperty.valueType() ) )
                {
                    underlyingNode.setProperty( "prop::" + stateName.toString(), prop );
                }
                else
                {
View Full Code Here

TOP

Related Classes of org.qi4j.api.property.PropertyDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.