Class JpaSpringDataUtil

    • 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.String getId​(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> O unproxy​(O entity)
      Unproxy the entity.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JpaSpringDataUtil

        public JpaSpringDataUtil​(org.springframework.context.ApplicationContext applicationContext,
                                 org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean containerEntityManagerFactoryBean)
    • Method Detail

      • getRepository

        public <O> org.springframework.data.jpa.repository.JpaRepository<? super O,​java.lang.String> getRepository​(O object)
        Description copied from interface: SpringDataUtil
        Determine the repository for the given object.
        Specified by:
        getRepository in interface SpringDataUtil
        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: SpringDataUtil
        Determine the repository for the given type.
        Specified by:
        getRepository in interface SpringDataUtil
        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: SpringDataUtil
        Determine the entity's object identifier.
        Specified by:
        getId in interface SpringDataUtil
        Parameters:
        domainEntity - The entity
        Returns:
        The id
        See Also:
        Id
      • unproxy

        public <O> O unproxy​(O entity)
        Description copied from interface: SpringDataUtil
        Unproxy the entity. This forces to load data if the proxy is not yet initialized.
        Specified by:
        unproxy in interface SpringDataUtil
        Type Parameters:
        O - The entity's type
        Parameters:
        entity - The entity
        Returns:
        The initialized entity