Skip to content

Commit

Permalink
Feat: HouseGeo Querydsl 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
KIMSEI1124 committed Sep 9, 2023
1 parent 1ad380d commit adb1d66
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.ssafy.tott.housegeo.data.cond;

import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.List;

@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Getter
public class HouseGeoFilterCond {
private String district;
private String legalDong;
private int minPrice;
private int maxPrice;
private int minArea;
private int maxArea;
private List<String> type;
private int buildingYear;
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.ssafy.tott.housegeo.domain;

import com.ssafy.tott.housegeo.domain.query.HouseGeoRepositoryCustom;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.Optional;

public interface HouseGeoRepository extends JpaRepository<HouseGeo, Integer> {
public interface HouseGeoRepository extends JpaRepository<HouseGeo, Integer>, HouseGeoRepositoryCustom {
Optional<HouseGeo> findByMainNumberAndSubNumber(int mainNumber, int subNumber);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.ssafy.tott.housegeo.domain.query;

import com.ssafy.tott.housegeo.data.cond.HouseGeoFilterCond;
import com.ssafy.tott.housegeo.domain.HouseGeo;

import java.util.List;

public interface HouseGeoRepositoryCustom {
List<HouseGeo> findByFilterCond(HouseGeoFilterCond cond);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.ssafy.tott.housegeo.domain.query;

import com.querydsl.jpa.impl.JPAQueryFactory;
import com.ssafy.tott.housegeo.data.cond.HouseGeoFilterCond;
import com.ssafy.tott.housegeo.domain.HouseGeo;

import javax.persistence.EntityManager;
import java.util.List;

public class HouseGeoRepositoryImpl implements HouseGeoRepositoryCustom {
private final JPAQueryFactory query;

public HouseGeoRepositoryImpl(EntityManager em) {
this.query = new JPAQueryFactory(em);
}

@Override
public List<HouseGeo> findByFilterCond(HouseGeoFilterCond cond) {
return null;
}
}

0 comments on commit adb1d66

Please sign in to comment.