Package org.lightadmin.core.persistence.repository

Examples of org.lightadmin.core.persistence.repository.DynamicJpaRepository


        return redirectTo("/page-not-found");
    }

    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


        this.delegate = repositoryInvokerFactory;
    }

    @Override
    public RepositoryInvoker getInvokerFor(Class<?> domainType) {
        DynamicJpaRepository dynamicJpaRepository = (DynamicJpaRepository) repositories.getRepositoryFor(domainType);
        RepositoryInvoker repositoryInvoker = delegate.getInvokerFor(domainType);

        return new DynamicRepositoryInvokerWrapper(dynamicJpaRepository, repositoryInvoker);
    }
View Full Code Here

    }

    @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

TOP

Related Classes of org.lightadmin.core.persistence.repository.DynamicJpaRepository

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.