Examples of PersistentEntity


Examples of org.springframework.data.mapping.PersistentEntity

    public static DynamicRepositoryEntityLinks wrap(EntityLinks delegate) {
        return new DynamicRepositoryEntityLinks(delegate);
    }

    public Link linkForFilePropertyLink(Object instance, PersistentProperty persistentProperty) {
        PersistentEntity persistentEntity = persistentProperty.getOwner();
        Serializable id = idValue(instance, persistentEntity);

        return delegate.linkForSingleResource(persistentEntity.getType(), id).slash(persistentProperty.getName()).slash("file").withSelfRel();
    }
View Full Code Here

Examples of org.springframework.data.mapping.PersistentEntity

    public boolean supports(Class<?> type) {
        return globalAdministrationConfiguration.isManagedDomainType(type);
    }

    public Link linkFor(PersistentEntityResource persistentEntityResource) {
        PersistentEntity persistentEntity = persistentEntityResource.getPersistentEntity();
        Object instance = persistentEntityResource.getContent();

        return linkToSingleResource(persistentEntity.getType(), idAttributeValue(instance, persistentEntity));
    }
View Full Code Here

Examples of org.springframework.data.mapping.PersistentEntity

    private Object findEntityOfDomain(String entityId, String domainTypeName) {
        DomainTypeAdministrationConfiguration domainTypeConfiguration = configuration.forEntityName(domainTypeName);
        DynamicJpaRepository repository = domainTypeConfiguration.getRepository();

        PersistentEntity persistentEntity = domainTypeConfiguration.getPersistentEntity();
        Serializable id = (Serializable) conversionService.convert(entityId, persistentEntity.getIdProperty().getActualType());

        return repository.findOne(id);
    }
View Full Code Here

Examples of org.springframework.data.mapping.PersistentEntity

        onAfterSave(entity);
    }

    @Override
    protected void onBeforeSave(Object entity) {
        PersistentEntity persistentEntity = persistentEntityFor(entity.getClass());

        NotEmptyFileReferencePropertiesCollector propertyValueCollector = new NotEmptyFileReferencePropertiesCollector(entity);
        persistentEntity.doWithProperties(propertyValueCollector);

        FileReferenceProperties fileReferenceProperties = propertyValueCollector.getFilePropertyValues();

        persistentEntity.doWithProperties(new FileReferencePropertiesValueEraser(entity, fileReferenceProperties));

        fileReferencePropertiesContext.set(fileReferenceProperties);
    }
View Full Code Here

Examples of org.springframework.data.mapping.PersistentEntity

        fileReferencePropertiesContext.set(fileReferenceProperties);
    }

    @Override
    protected void onAfterSave(Object entity) {
        PersistentEntity persistentEntity = persistentEntityFor(entity.getClass());
        DynamicJpaRepository repository = repositoryFor(entity.getClass());

        FileReferenceProperties fileReferenceProperties = fileReferencePropertiesContext.get();
        try {
            persistentEntity.doWithProperties(new FileReferencePropertiesSaveHandler(entity, fileReferenceProperties));

            repository.save(entity);
        } finally {
            fileReferencePropertiesContext.remove();
        }
View Full Code Here

Examples of org.springframework.data.mapping.PersistentEntity

        }
    }

    @Override
    protected void onAfterDelete(final Object entity) {
        PersistentEntity persistentEntity = persistentEntityFor(entity.getClass());

        persistentEntity.doWithProperties(new PersistentPropertyFileDeletionHandler(entity));
    }
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.