Skip to content

Commit 481deb1

Browse files
committed
feat: location 도메인 queryDsl 적용
1 parent 4b31cf5 commit 481deb1

File tree

3 files changed

+45
-2
lines changed

3 files changed

+45
-2
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.somemore.location.repository;
2+
3+
import com.somemore.location.domain.Location;
4+
import org.springframework.data.jpa.repository.JpaRepository;
5+
6+
public interface LocationJpaRepository extends JpaRepository<Location, Long> {
7+
8+
}
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
package com.somemore.location.repository;
22

33
import com.somemore.location.domain.Location;
4-
import org.springframework.data.jpa.repository.JpaRepository;
4+
import java.util.Optional;
55

6-
public interface LocationRepository extends JpaRepository<Location, Long> {
6+
public interface LocationRepository {
77

8+
Location save(Location location);
9+
10+
Optional<Location> findById(Long id);
11+
12+
void deleteAllInBatch();
813
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.somemore.location.repository;
2+
3+
import com.querydsl.jpa.impl.JPAQueryFactory;
4+
import com.somemore.location.domain.Location;
5+
import java.util.Optional;
6+
import lombok.RequiredArgsConstructor;
7+
import org.springframework.stereotype.Repository;
8+
9+
@RequiredArgsConstructor
10+
@Repository
11+
public class LocationRepositoryImpl implements LocationRepository {
12+
13+
private final LocationJpaRepository locationJpaRepository;
14+
private final JPAQueryFactory queryFactory;
15+
16+
@Override
17+
public Location save(Location location) {
18+
return locationJpaRepository.save(location);
19+
}
20+
21+
@Override
22+
public Optional<Location> findById(Long id) {
23+
return locationJpaRepository.findById(id);
24+
}
25+
26+
@Override
27+
public void deleteAllInBatch() {
28+
locationJpaRepository.deleteAllInBatch();
29+
}
30+
}

0 commit comments

Comments
 (0)