Package io.vanillabp.springboot.utils
Class JpaSpringDataUtil
- java.lang.Object
-
- io.vanillabp.springboot.utils.JpaSpringDataUtil
-
- All Implemented Interfaces:
SpringDataUtil
public class JpaSpringDataUtil extends java.lang.Object implements SpringDataUtil
-
-
Constructor Summary
Constructors Constructor Description JpaSpringDataUtil(org.springframework.context.ApplicationContext applicationContext, org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean containerEntityManagerFactoryBean)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetId(java.lang.Object domainEntity)Determine the entity's object identifier.<O> org.springframework.data.jpa.repository.JpaRepository<O,java.lang.String>getRepository(java.lang.Class<O> type)Determine the repository for the given type.<O> org.springframework.data.jpa.repository.JpaRepository<? super O,java.lang.String>getRepository(O object)Determine the repository for the given object.<O> Ounproxy(O entity)Unproxy the entity.
-
-
-
Method Detail
-
getRepository
public <O> org.springframework.data.jpa.repository.JpaRepository<? super O,java.lang.String> getRepository(O object)
Description copied from interface:SpringDataUtilDetermine the repository for the given object.- Specified by:
getRepositoryin interfaceSpringDataUtil- Type Parameters:
O- The entity's expected type.- Parameters:
object- The entity- Returns:
- The repository
-
getRepository
public <O> org.springframework.data.jpa.repository.JpaRepository<O,java.lang.String> getRepository(java.lang.Class<O> type)
Description copied from interface:SpringDataUtilDetermine the repository for the given type.- Specified by:
getRepositoryin interfaceSpringDataUtil- Type Parameters:
O- The entity's expected type.- Returns:
- The repository
-
getId
public java.lang.String getId(java.lang.Object domainEntity)
Description copied from interface:SpringDataUtilDetermine the entity's object identifier.- Specified by:
getIdin interfaceSpringDataUtil- Parameters:
domainEntity- The entity- Returns:
- The id
- See Also:
Id
-
unproxy
public <O> O unproxy(O entity)
Description copied from interface:SpringDataUtilUnproxy the entity. This forces to load data if the proxy is not yet initialized.- Specified by:
unproxyin interfaceSpringDataUtil- Type Parameters:
O- The entity's type- Parameters:
entity- The entity- Returns:
- The initialized entity
-
-