Versions Compared

Key

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

...

처음작성은 어색하지만, 완성이되면 가독성및 사용성이 훨씬더 간편해집니다.


함수쿼리 짧게만들기

Code Block
public interface AddressRepo extends CrudRepository<Address, Long>{
	List<Address> findByAgeGreaterThanAndSex(int age,String sex);
	default List<Address> findList(int age,String sex)
	{
    	return findByAgeGreaterThanAndSex(age,sex)
	}
}

함수쿼리는 조건이 많아질수록 길어지는 단점이 있으며, 짧게 사용하고싶으면

위와같이 함수맵핑을 통해 짧게사용가능합니다.


GROUP BY

draw.io Diagram
bordertrue
viewerToolbartrue
fitWindowfalse
diagramNamegroupby2
simpleViewerfalse
width
diagramWidth271
revision2

...