Skip to content

Commit

Permalink
[ADD] #26 add jpa support plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
heowc committed Mar 31, 2019
1 parent a1336dd commit 4d9460d
Show file tree
Hide file tree
Showing 14 changed files with 11 additions and 39 deletions.
1 change: 1 addition & 0 deletions SpringBootCache/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id 'org.springframework.boot' version '2.1.3.RELEASE'
id 'org.jetbrains.kotlin.jvm' version '1.2.71'
id 'org.jetbrains.kotlin.plugin.spring' version '1.2.71'
id "org.jetbrains.kotlin.plugin.jpa" version "1.2.71"
}

apply plugin: 'io.spring.dependency-management'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package com.example.kotlin.domain

data class Book(val isbn: String, val title: String) {
constructor() : this("", "")
}
data class Book(val isbn: String, val title: String)
1 change: 1 addition & 0 deletions SpringBootConfigurable/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id 'org.springframework.boot' version '2.1.3.RELEASE'
id 'org.jetbrains.kotlin.jvm' version '1.2.71'
id 'org.jetbrains.kotlin.plugin.spring' version '1.2.71'
id "org.jetbrains.kotlin.plugin.jpa" version "1.2.71"
}

apply plugin: 'io.spring.dependency-management'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ class Account(@Id val id: String,
@Transient
lateinit var passwordEncoder: PasswordEncoder

constructor() : this("", "")

fun resetPassword() {
val newPassword = RandomStringUtils.randomAlphanumeric(10)
this.password = passwordEncoder.encode(newPassword)
Expand Down
1 change: 1 addition & 0 deletions SpringBootJpa/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id 'org.springframework.boot' version '2.1.3.RELEASE'
id 'org.jetbrains.kotlin.jvm' version '1.2.71'
id 'org.jetbrains.kotlin.plugin.spring' version '1.2.71'
id "org.jetbrains.kotlin.plugin.jpa" version "1.2.71"
}

apply plugin: 'io.spring.dependency-management'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@ data class Order(
@ManyToOne @JoinColumn(name = "PRODUCT_IDX")
var product: Product? = null
) {

constructor() : this(null, null, null, null)

override fun toString(): String {
return "Order{" +
"idx=" + idx +
", productCount=" + productCount +
", bigo='" + bigo + '\''.toString() +
", product=" + product!!.name +
", product=" + product?.name +
'}'.toString()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,4 @@ data class Product(
var name: String? = null,
@Column(name = "CONTENT")
var content: String? = null
) {

constructor() : this(null, null, null)

override fun toString(): String {
return "Product{" +
"idx=" + idx +
", name='" + name + '\''.toString() +
", content='" + content + '\''.toString() +
'}'.toString()
}
}
)
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ data class Market(
@OneToOne @JoinColumn(name = "MARKET_ID")
var owner: Owner? = null) {

constructor() : this(null, null, null, null)

override fun toString(): String {
return "Market(idx=$idx, name=$name, location=$location, owner=${owner?.name})"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,4 @@ data class Owner(
var name: String? = null,
@OneToOne @JoinColumn(name = "OWNER_ID")
var market: Market? = null
) {
constructor() : this(null, null, null)

override fun toString(): String {
return "Owner(idx=$idx, name=$name, market=${market?.name})"
}
}
)
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ data class Customer(
@Column(length = 14) val tel: String,
var bigo: String) {

constructor() : this(null, "", "", "")

fun changeBigo(bigo: String) {
this.bigo = bigo
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,4 @@ import java.time.LocalDateTime
@Entity
data class TimeData(
@Id @GeneratedValue val idx: Long? = null,
val date: LocalDateTime) {

constructor() : this(null, LocalDateTime.now())
}
val date: LocalDateTime)
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import org.springframework.test.context.junit4.SpringRunner

@RunWith(SpringRunner::class)
@DataJpaTest
open class CustomerRepositoryTests {
class CustomerRepositoryTests {

@Autowired
lateinit var repository: CustomerRepository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.springframework.test.context.junit4.SpringRunner

@RunWith(SpringRunner::class)
@DataJpaTest
open class EntityManagerTests {
class EntityManagerTests {

@Autowired
lateinit var testEntityManager: TestEntityManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import org.springframework.transaction.annotation.Transactional
@RunWith(SpringRunner::class)
@SpringBootTest
@Transactional
open class OneToOneTests {
class OneToOneTests {

@Autowired
lateinit var marketRepository: MarketRepository
Expand Down

0 comments on commit 4d9460d

Please sign in to comment.