Examples of propertyFor()


Examples of org.qi4j.api.association.AssociationStateHolder.propertyFor()

            }

            AssociationStateHolder state = (AssociationStateHolder) Qi4j.INSTANCE_FUNCTION.map( valueComposite ).state();
            for( PropertyDescriptor persistentProperty : valueCompositeType.properties() )
            {
                Property<?> property = state.propertyFor( persistentProperty.accessor() );
                key( persistentProperty.qualifiedName().name() ).serialize( property.get(), persistentProperty.valueType() );
            }
            for( AssociationDescriptor associationDescriptor : valueCompositeType.associations() )
            {
                Association<?> association = state.associationFor( associationDescriptor.accessor() );
View Full Code Here

Examples of org.qi4j.api.association.AssociationStateHolder.propertyFor()

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

Examples of org.qi4j.api.association.AssociationStateHolder.propertyFor()

                    {
                        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

Examples of org.qi4j.api.association.AssociationStateHolder.propertyFor()

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

Examples of org.qi4j.api.association.AssociationStateHolder.propertyFor()

                    {
                        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

Examples of org.qi4j.api.association.AssociationStateHolder.propertyFor()

            Object[] rowData = new Object[ model.getColumnCount() ];
            int i = 0;
            for( PropertyDescriptor persistentPropertyDescriptor : descriptor.state().properties() )
            {
                rowData[ i++] = state.propertyFor( persistentPropertyDescriptor.accessor() );
            }
            model.addRow( rowData );
        }

        return model;
View Full Code Here

Examples of org.qi4j.api.association.AssociationStateHolder.propertyFor()

                UnitOfWork uow = module.newUnitOfWork();
                try {
                    EntityComposite configuration = uow.get( EntityComposite.class, identity );
                    AssociationStateHolder state = spi.stateOf( configuration );
                    AccessibleObject accessor = propertyNames.get( name );
                    Property<Object> property = state.propertyFor( accessor );
                    return property.get();
                } catch ( Exception ex ) {
                    throw new ReflectionException( ex, "Could not get attribute " + name );
                } finally {
                    uow.discard();
View Full Code Here

Examples of org.qi4j.api.association.AssociationStateHolder.propertyFor()

                UnitOfWork uow = module.newUnitOfWork();
                try {
                    EntityComposite configuration = uow.get( EntityComposite.class, identity );
                    AssociationStateHolder state = spi.stateOf( configuration );
                    AccessibleObject accessor = propertyNames.get( attribute.getName() );
                    Property<Object> property = state.propertyFor( accessor );
                    property.set( attribute.getValue() );
                    try {
                        uow.complete();
                    } catch ( UnitOfWorkCompletionException e ) {
                        throw new ReflectionException( e );
View Full Code Here

Examples of org.qi4j.api.association.AssociationStateHolder.propertyFor()

                try
                {
                    EntityComposite configuration = uow.get( EntityComposite.class, identity );
                    AssociationStateHolder state = spi.stateOf( configuration );
                    AccessibleObject accessor = propertyNames.get( name );
                    Property<Object> property = state.propertyFor( accessor );
                    Object object = property.get();
                    if( object instanceof Enum )
                    {
                        object = object.toString();
                    }
View Full Code Here

Examples of org.qi4j.api.association.AssociationStateHolder.propertyFor()

                try
                {
                    EntityComposite configuration = uow.get( EntityComposite.class, identity );
                    AssociationStateHolder state = spi.stateOf( (EntityComposite) configuration );
                    AccessibleObject accessor = propertyNames.get( attribute.getName() );
                    Property<Object> property = state.propertyFor( accessor );
                    PropertyDescriptor propertyDescriptor = spi.propertyDescriptorFor( property );
                    if( EnumType.isEnum( propertyDescriptor.type() ) )
                    {
                        property.set( Enum.valueOf( (Class<Enum>) propertyDescriptor.type(), attribute.getValue()
                            .toString() ) );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.