Skip to content

Commit

Permalink
Merge pull request #37 from JNU-econovation/chore
Browse files Browse the repository at this point in the history
[CHORE] query 구현 모듈의 기술 변경 / 루트 모듈 그룹명 변경
  • Loading branch information
inferior3x authored Nov 14, 2024
2 parents 4850eb4 + a548318 commit c4ddb7c
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 11 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'java'
}

group = 'com.Whoz-In'
group = 'com.whoz_in'
version = '0.0.1-SNAPSHOT'

java {
Expand Down
2 changes: 1 addition & 1 deletion modules/api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies {

//for api DI (runtimeOnly - 순환 의존 방지)
runtimeOnly project(":modules:infrastructure:spring")
runtimeOnly project(":modules:infrastructure:api-query-domain-jpa")
runtimeOnly project(":modules:infrastructure:api-query-jpa")

//직접 의존
implementation 'org.springframework.boot:spring-boot-starter'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ repositories {

dependencies {
compileOnly project(":modules:api")
implementation project(":modules:infrastructure:domain-jpa")

implementation 'org.springframework.boot:spring-boot-starter-data-jpa:3.3.4'
// runtimeOnly 'com.mysql:mysql-connector-j:8.3.0'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.whoz_in.api_query_domain_jpa;

import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import org.hibernate.annotations.Immutable;
import org.hibernate.annotations.Subselect;
import org.hibernate.annotations.Synchronize;

@Entity
@Immutable
@Subselect("SELECT "
+ "d.device_id AS deviceId "
+ "FROM device_entity d")
@Synchronize({"device_entity"})
public class Device {
@Id
private Long deviceId;

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,22 @@
import com.whoz_in.api.query.device_info.application.DeviceInfo;
import com.whoz_in.api.query.device_info.application.DeviceInfoViewer;
import com.whoz_in.api.query.device_info.application.DevicesInfo;
import com.whoz_in.domain_jpa.device.DeviceEntity;
import com.whoz_in.domain_jpa.device.DeviceJpaRepository;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
public class DeviceInfoJpaViewer implements DeviceInfoViewer {
private final DeviceJpaRepository deviceJpaRepository;

@Override
public DeviceInfo findByDeviceId(Long deviceId) {
deviceJpaRepository.findById(deviceId);
deviceJpaRepository.save(new DeviceEntity());
return new DeviceInfo();
}

@Override
public DevicesInfo findAll() {
List<DeviceEntity> devices = deviceJpaRepository.findAll();

return new DevicesInfo();
}
}
4 changes: 2 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ include 'modules:infrastructure:domain-jpa'
findProject(':modules:infrastructure:domain-jpa')?.name = 'domain-jpa'
include 'modules:infrastructure:spring'
findProject(':modules:infrastructure:spring')?.name = 'spring'
include 'modules:infrastructure:api-query-domain-jpa'
findProject(':modules:infrastructure:api-query-domain-jpa')?.name = 'api-query-domain-jpa'
include 'modules:infrastructure:api-query-jpa'
findProject(':modules:infrastructure:api-query-jpa')?.name = 'api-query-jpa'

0 comments on commit c4ddb7c

Please sign in to comment.