Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
themeEmacs
public interface AddressCustomRepositoryMyAddressRepository  {
	void someTest(Address2 address2);
}


public class AddressCustomRepositoryImplAddressRepositoryImpl implements AddressCustomRepositoryMyAddressRepository { 
	@PersistenceContext
	private EntityManager em;
	  
	@Override
	@Transactional
	public void someTest(Address2 address2) {
		em.refresh(address2);		
		em.detach(address2);
		em.persist(address2);
		em.lock(address2, null);
		em.flush();
	}	  
}
public interface AddressRepo2AddressRepository extends JpaRepository<Address2, Long>,AddressCustomRepositoryMyAddressRepository {	
		
}

CRUDRepository에서 하지못한 몇가지 이상행동을 수행 해보겠습니다. 

...


}

네이밍 룰

네이밍설명
MyAddressRepository

인터페이스이며, 커스텀함 함수규격을 미리 설명을 해놓아야합니다.

네이밍 특성 : 특성+테이블명+저장소

My + Address + Repository

AddressRepositoryImpl

커스텀한 구현체를 정의합니다.

네이밍 특성: 테이블명+저장소+구현

MyAddressRepositoryImpx ( X )

AddressRepository

최종 사용가능해진 저장소이름입니다. JPA의 기본 저장소 특성과함께

사용자 정의 기능을 함께 사용가능합니다.

네이밍특성: 테이블명+저장소

...




Insert


Update


Delete