-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: SafetyFacility entity, repository 추가
- Loading branch information
lovee9523
committed
Apr 8, 2024
1 parent
d808d07
commit b306939
Showing
3 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
...main/java/seouldata/seoul_backend/domain/safteyfacility/domain/entity/SafetyFacility.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package seouldata.seoul_backend.domain.safteyfacility.domain.entity; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.AccessLevel; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Entity | ||
@Table(name = "an_safety_facilities") | ||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class SafetyFacility { | ||
|
||
@EmbeddedId | ||
private SafetyFacilityId id; | ||
|
||
private String city; | ||
private String dong; | ||
|
||
@Column(name = "road_name") | ||
private String road; | ||
private Long number; | ||
|
||
// private String lon; | ||
// private double lat; | ||
// @Column(name = "facility_name") | ||
// private String name; | ||
|
||
@Builder | ||
public SafetyFacility(String city, String dong, String road, Long number) { | ||
this.city = city; | ||
this.dong = dong; | ||
this.road = road; | ||
this.number = number; | ||
|
||
} | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
...in/java/seouldata/seoul_backend/domain/safteyfacility/domain/entity/SafetyFacilityId.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package seouldata.seoul_backend.domain.safteyfacility.domain.entity; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Embeddable; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.io.Serializable; | ||
|
||
@Getter | ||
@Embeddable | ||
@NoArgsConstructor | ||
@EqualsAndHashCode | ||
public class SafetyFacilityId implements Serializable { | ||
|
||
@Column(name = "lon") | ||
private String lon; | ||
@Column(name = "lat") | ||
private double lat; | ||
@Column(name = "facility_name") | ||
private String name; | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
...ldata/seoul_backend/domain/safteyfacility/domain/repository/SafetyFacilityRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package seouldata.seoul_backend.domain.safteyfacility.domain.repository; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import seouldata.seoul_backend.domain.safteyfacility.domain.entity.SafetyFacility; | ||
import seouldata.seoul_backend.domain.safteyfacility.domain.entity.SafetyFacilityId; | ||
|
||
public interface SafetyFacilityRepository extends JpaRepository<SafetyFacility, SafetyFacilityId> { | ||
} |