Examples of MappingPolicy


Examples of com.sun.jdo.spi.persistence.generator.database.MappingPolicy

    private DatabaseGenerator.Results generateSchema(List pcClasses,
            String dbName, String useUniqueTableNames,
            Properties userPolicy)
            throws IOException, DBException, ModelException {

        MappingPolicy mappingPolicy = MappingPolicy.getMappingPolicy(dbName);
        mappingPolicy.setUserPolicy(userPolicy);

        if (isPropertyDefined(useUniqueTableNames)) {
            // It was explicitly set.
            mappingPolicy.setUniqueTableName(
                Boolean.valueOf(useUniqueTableNames).booleanValue());
        }

       return DatabaseGenerator.generate(
                model, pcClasses, mappingPolicy,
View Full Code Here

Examples of com.sun.jdo.spi.persistence.generator.database.MappingPolicy

    private DatabaseGenerator.Results generateSchema(List pcClasses,
            String dbName, Boolean useUniqueTableNames,
            Properties userPolicy)
            throws IOException, DBException, ModelException {

        MappingPolicy mappingPolicy = MappingPolicy.getMappingPolicy(dbName);
        mappingPolicy.setUserPolicy(userPolicy);

        if (useUniqueTableNames != null) {
            // It was explicitly set.
            mappingPolicy.setUniqueTableName(useUniqueTableNames.booleanValue());
        }

       return DatabaseGenerator.generate(
                model, pcClasses, mappingPolicy,
                infoHelper.getSchemaNameToGenerate(), CLASS_SUFFIX, true);
View Full Code Here

Examples of org.springframework.data.neo4j.mapping.MappingPolicy

        if (state != null) return state;
        final S containedState = getPersistentState(entity);
        if (containedState != null) return containedState;
        final Class<?> type = entity.getClass();
        final Neo4jPersistentEntityImpl<?> persistentEntity = mappingContext.getPersistentEntity(type);
        final MappingPolicy mappingPolicy = persistentEntity.getMappingPolicy();
        // todo observe load policy
        if (persistentEntity.isNodeEntity()) {
            if (persistentEntity.isUnique()) return (S)createUniqueNode(persistentEntity,entity);
            return createNode(persistentEntity);
        }
View Full Code Here

Examples of org.springframework.data.neo4j.mapping.MappingPolicy

    public void testCreatePersonWithCreator() {
        Person p = persistedPerson("Rod", 39);
        long nodeId = getNodeId(p);

        Node node = neo4jTemplate.getNode(nodeId);
        final MappingPolicy mappingPolicy = neo4jTemplate.getMappingPolicy(Person.class);
        Person person1 = (Person) neo4jTemplate.createEntityFromStoredType(node, mappingPolicy);
        assertEquals("Rod", person1.getName());
        Person person2 = neo4jTemplate.createEntityFromState(node,Person.class, mappingPolicy);
        assertEquals("Rod", person2.getName());
View Full Code Here

Examples of org.springframework.data.neo4j.mapping.MappingPolicy

    // todo actually cascade !!
    public Object fetch(final Object value, Neo4jPersistentEntity<Object> persistentEntity, Neo4jPersistentProperty property, final MappingPolicy policy, final Neo4jTemplate template) {
        if (value == null) return value;
        //MappingPolicy mappingPolicy = mappingPolicy.combineWith(property.getMappingPolicy());
        final MappingPolicy mappingPolicy = property.getMappingPolicy();
        if (!mappingPolicy.shouldLoad()) return value;
        if (property.getTypeInformation().isCollectionLike()) {
            List<Object> replacement = new ArrayList<Object>();
            for (Object inner : ((Iterable) value)) {
                final BeanWrapper<Object> innerWrapper = BeanWrapper.create(inner, conversionService);
                final PropertyContainer state = entityStateHandler.getPersistentState(inner);
View Full Code Here

Examples of org.springframework.data.neo4j.mapping.MappingPolicy

        }

        @Override
        public Object getValue(final Object entity, MappingPolicy mappingPolicy) {
            checkAndGetNode(entity);
            final MappingPolicy currentPolicy = property.obtainMappingPolicy(mappingPolicy);
            final Set<?> result = property.isTargetTypeEnforced() ?
                    createEntitySetFromRelationshipEndNodesUsingTypeProperty(entity, currentPolicy) :
                    createEntitySetFromRelationshipEndNodes(entity, currentPolicy);

            Set<Object> values = new HashSet<Object>();
View Full Code Here

Examples of org.springframework.data.neo4j.mapping.MappingPolicy

                for (final Map.Entry<Neo4jPersistentProperty, ExistingValue> entry : dirtyCopy.entrySet()) {
                    final Neo4jPersistentProperty property = entry.getKey();
                    Object valueFromEntity = getValueFromEntity(property, MappingPolicy.MAP_FIELD_DIRECT_POLICY);
                    cascadePersist(valueFromEntity);
                    if (log.isDebugEnabled()) log.debug("Flushing dirty Entity new node " + entity + " field " + property+ " with value "+ valueFromEntity);
                    final MappingPolicy mappingPolicy = property.getMappingPolicy();
                    checkConcurrentModification(entity, entry, property, mappingPolicy);
                    delegate.setValue(property, valueFromEntity, mappingPolicy);
                    dirty.remove(property);
                    if (valueFromEntity instanceof DirtyValue) {
                        ((DirtyValue)valueFromEntity).setDirty(false);
View Full Code Here

Examples of org.springframework.data.neo4j.mapping.MappingPolicy

        }

        @Override
        public Object getValue(final Object entity, MappingPolicy mappingPolicy) {
            checkAndGetNode(entity);
            MappingPolicy currentPolicy = property.obtainMappingPolicy(mappingPolicy);
            final Set<?> result = property.isTargetTypeEnforced() ?
                    createEntitySetFromRelationshipEndNodesUsingTypeProperty(entity, currentPolicy) :
                    createEntitySetFromRelationshipEndNodes(entity, currentPolicy);

            if (result.isEmpty()) return doReturn(null);
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.