Package org.springframework.data.neo4j.annotation

Examples of org.springframework.data.neo4j.annotation.NodeEntity


    private Neo4JMappingContext mappingContext;

    public EntityState<NodeBacked,Node> getEntityState(final NodeBacked entity) {
        final Class<? extends NodeBacked> entityType = entity.getClass();
        final NodeEntity graphEntityAnnotation = entityType.getAnnotation(NodeEntity.class); // todo cache ??
        final Neo4JPersistentEntity<?> persistentEntity = mappingContext.getPersistentEntity(entityType);
        if (graphEntityAnnotation.partial()) {
            final PartialNodeEntityState<NodeBacked> partialNodeEntityState = new PartialNodeEntityState<NodeBacked>(null, entity, entityType, graphDatabaseContext, getPersistenceUnitUtils(), delegatingFieldAccessorFactory, (Neo4JPersistentEntity<NodeBacked>) persistentEntity);
            return new DetachedEntityState<NodeBacked, Node>(partialNodeEntityState, graphDatabaseContext) {
                @Override
                protected boolean isDetached() {
                    return super.isDetached() || partialNodeEntityState.getId(entity) == null;
View Full Code Here


            annotations.put(annotation.annotationType(),annotation);
        }
    }

    public boolean useShortNames() {
        final NodeEntity graphEntity = getAnnotation(NodeEntity.class);
        if (graphEntity != null) return graphEntity.useShortNames();
        final RelationshipEntity graphRelationship = getAnnotation(RelationshipEntity.class);
        if (graphRelationship != null) return graphRelationship.useShortNames();
        return false;
    }
View Full Code Here

    public boolean useShortNames() {
        return shouldUseShortNames;
    }

    private boolean shouldUseShortNames() {
        final NodeEntity graphEntity = getAnnotation(NodeEntity.class);
        if (graphEntity != null) return graphEntity.useShortNames();
        final RelationshipEntity graphRelationship = getAnnotation(RelationshipEntity.class);
        if (graphRelationship != null) return graphRelationship.useShortNames();
        return false;
    }
View Full Code Here

            return super.getEntityState(entity,detachable, template);
        }
    }

    private boolean isPartial(Class<?> entityType) {
        final NodeEntity graphEntityAnnotation = entityType.getAnnotation(NodeEntity.class); // todo cache ??
        return graphEntityAnnotation.partial();
    }
View Full Code Here

TOP

Related Classes of org.springframework.data.neo4j.annotation.NodeEntity

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.