io.crnk.jpa.JpaRepositoryFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of crnk-jpa Show documentation
Show all versions of crnk-jpa Show documentation
JSON API framework for Java
package io.crnk.jpa;
import io.crnk.core.engine.information.resource.ResourceField;
import java.io.Serializable;
/**
* Used to create document and relationship repositories for the provided
* classes. By default {@link DefaultJpaRepositoryFactory}} is used.
*/
public interface JpaRepositoryFactory {
/**
* Creates a document document that maps an entity to a JSON API endpoint. The provided document class not necessarily has to be
* an entity class. The JpaModule is checked whether there is a mapping available.
*
* @param document type
* @param identifier type
* @param module managing the document
* @param config for this document
* @return created document
*/
JpaEntityRepository createEntityRepository(JpaModule module,
JpaRepositoryConfig config);
/**
* Creates a relationship document that maps an entity relationship to a JSON API endpoint. The provided document classes do not necessarily have to be
* an entity class. The JpaModule is checked whether there is a mapping available.
*
* @param source document type
* @param source identifier type
* @param target document type
* @param target identifier type
* @param module managing the document
* @param resourceField representing the source field of the relation (entity or mapped dto)
* @param config for this document
* @return created document
*/
JpaRelationshipRepository createRelationshipRepository(
JpaModule module, ResourceField resourceField, JpaRepositoryConfig config);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy