Package org.qi4j.api.entity

Examples of org.qi4j.api.entity.EntityDescriptor.state()


                throw new EntityTypeNotFoundException( type );
            }

            Map<QualifiedName, Object> properties = new HashMap<>();
            JSONObject props = jsonObject.getJSONObject( JSONKeys.PROPERTIES );
            for( PropertyDescriptor propertyDescriptor : entityDescriptor.state().properties() )
            {
                Object jsonValue;
                try
                {
                    jsonValue = props.get( propertyDescriptor.qualifiedName().name() );
View Full Code Here


                }
            }

            Map<QualifiedName, EntityReference> associations = new HashMap<>();
            JSONObject assocs = jsonObject.getJSONObject( JSONKeys.ASSOCIATIONS );
            for( AssociationDescriptor associationType : entityDescriptor.state().associations() )
            {
                try
                {
                    Object jsonValue = assocs.get( associationType.qualifiedName().name() );
                    EntityReference value = jsonValue == JSONObject.NULL ? null : EntityReference.parseEntityReference(
View Full Code Here

                }
            }

            JSONObject manyAssocs = jsonObject.getJSONObject( JSONKeys.MANY_ASSOCIATIONS );
            Map<QualifiedName, List<EntityReference>> manyAssociations = new HashMap<>();
            for( AssociationDescriptor manyAssociationType : entityDescriptor.state().manyAssociations() )
            {
                List<EntityReference> references = new ArrayList<>();
                try
                {
                    JSONArray jsonValues = manyAssocs.getJSONArray( manyAssociationType.qualifiedName().name() );
View Full Code Here

            JSONObject namedAssocs = jsonObject.has( JSONKeys.NAMED_ASSOCIATIONS )
                                     ? jsonObject.getJSONObject( JSONKeys.NAMED_ASSOCIATIONS )
                                     : new JSONObject();
            Map<QualifiedName, Map<String, EntityReference>> namedAssociations = new HashMap<>();
            for( AssociationDescriptor namedAssociationType : entityDescriptor.state().namedAssociations() )
            {
                Map<String, EntityReference> references = new LinkedHashMap<>();
                try
                {
                    JSONObject jsonValues = namedAssocs.getJSONObject( namedAssociationType.qualifiedName().name() );
View Full Code Here

                throw new EntityTypeNotFoundException( type );
            }

            Map<QualifiedName, Object> properties = new HashMap<>();
            Preferences propsPrefs = null;
            for( PropertyDescriptor persistentPropertyDescriptor : entityDescriptor.state().properties() )
            {
                if( persistentPropertyDescriptor.qualifiedName().name().equals( "identity" ) )
                {
                    // Fake identity property
                    properties.put( persistentPropertyDescriptor.qualifiedName(), identity.identity() );
View Full Code Here

            }

            // Associations
            Map<QualifiedName, EntityReference> associations = new HashMap<>();
            Preferences assocs = null;
            for( AssociationDescriptor associationType : entityDescriptor.state().associations() )
            {
                if( assocs == null )
                {
                    assocs = entityPrefs.node( "associations" );
                }
View Full Code Here

            }

            // ManyAssociations
            Map<QualifiedName, List<EntityReference>> manyAssociations = new HashMap<>();
            Preferences manyAssocs = null;
            for( AssociationDescriptor manyAssociationType : entityDescriptor.state().manyAssociations() )
            {
                if( manyAssocs == null )
                {
                    manyAssocs = entityPrefs.node( "manyassociations" );
                }
View Full Code Here

            }

            // NamedAssociations
            Map<QualifiedName, Map<String, EntityReference>> namedAssociations = new HashMap<>();
            Preferences namedAssocs = null;
            for( AssociationDescriptor namedAssociationType : entityDescriptor.state().namedAssociations() )
            {
                if( namedAssocs == null )
                {
                    namedAssocs = entityPrefs.node( "namedassociations" );
                }
View Full Code Here

            AssociationStateHolder state = qi4jspi.stateOf( (EntityComposite) qObj );
            EntityDescriptor descriptor = qi4jspi.entityDescriptorFor( (EntityComposite) qObj );
            // genereate column, first time only
            if( model.getColumnCount() < 1 )
            {
                for( PropertyDescriptor persistentPropertyDescriptor : descriptor.state()
                    .properties() )
                {
                    model.addColumn( persistentPropertyDescriptor.qualifiedName().name() );
                }
            }
View Full Code Here

                }
            }

            Object[] rowData = new Object[ model.getColumnCount() ];
            int i = 0;
            for( PropertyDescriptor persistentPropertyDescriptor : descriptor.state().properties() )
            {
                rowData[ i++] = state.propertyFor( persistentPropertyDescriptor.accessor() );
            }
            model.addRow( rowData );
        }
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.