QueryParameter - Sort/search?category=book&price=1000&page=0&size=10&sort=id,asc&sort=price,desc 정렬 조건은 queryparameter를 통해 주로 전달합니다.ex) sort=id,asc- 위 코드는 id 값을 기준으로 오름차순 정렬을 의미합니다. 복수 개의 정렬은 단일 조건이 여러 번 전달받는 것과 같습니다.ex) sort=id,asc&sort=price,desc querydsl에서 정렬 조건을 주기 위해 2가지 방법이 있습니다.QEntity.field.asc() / QEntity.field.desc()첫 번째는 정적인 방법으로 QEntity.field.asc() / QEntity.field.desc() 방법이 있습니다.ret..
JPAExpressionTo create a subquery you use the static factory methods of JPAExpressions. examplequeryFactory.selectFrom(department) .where(department.size.eq( JPAExpressions.select(d.size.max()).from(d))) .fetch(); where 절에 서브쿼리 적용하기 (eq)@Testpublic void subQuery() throws Exception { QMember memberSub = new QMember("memberSub"); List result = queryFactory .selectFrom(member)..
StdSerializerBean class used by all standard serializers, and can also be used for custom serializers.즉, 객체를 JSON으로 직렬화할 때 사용하는 커스텀 직렬화 로직을 구현할 수 있게 도와주는 추상 클래스이다. ObjectMapper may not handle your domain correctly. You can structure your data in so many ways that you may find your own domain model does not correctly translate to JSON. StdSerializer는 제네릭 타입 T를 받아들입니다. T는 직렬화하려는 대상 객체의 타입을 나타냅니다.주..
Sigleton Scopethe container creates a single instance of that bean all requests for that bean name will return the same object. Any modifications to the object will be reflected in all references to the bean. This scope is the default value if no other scope is specified.Sigleton Scope인 경우 빈에 대한 모든 요청은 같은 객체를 반환합니다.객체에 대한 어떤 변경이 있는 경우 빈을 참조하는 다른 곳에도 반영이 됩니다.즉, 싱글톤 방식으로 빈을 관리합니다.@Bean@Scope("sing..