-
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.
Merge pull request #4 from WantAirpod/dev
feat : Java에서 Kotlin으로 전환
- Loading branch information
Showing
6 changed files
with
50 additions
and
18 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
library-app/src/main/java/com/group/libraryapp/domain/book/BookRepository.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
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
3 changes: 2 additions & 1 deletion
3
library-app/src/main/java/com/group/libraryapp/domain/user/User.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
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
31 changes: 31 additions & 0 deletions
31
library-app/src/main/kotlin/com/group/libraryapp/calculator/domain/Book.kt
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,31 @@ | ||
package com.group.libraryapp.calculator.domain | ||
|
||
import javax.persistence.Entity | ||
import javax.persistence.GeneratedValue | ||
import javax.persistence.GenerationType | ||
import javax.persistence.Id | ||
|
||
@Entity | ||
class Book ( | ||
|
||
val name: String, | ||
/** | ||
* val : id는 한 번 생기면 불변이다. | ||
* Long : type 이며 | ||
* ? : null이 가능하다. | ||
* = null : 초기화 | ||
*/ | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
val id: Long? = null, | ||
) { | ||
|
||
|
||
//초기화 블록 | ||
init{ | ||
if(name.isBlank()){ | ||
throw IllegalArgumentException("이름은 비어 있을 수 없습니다.") | ||
} | ||
} | ||
} |
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