@@ -4,16 +4,16 @@ import org.seasar.doma.Dao
4
4
import org.seasar.doma.Select
5
5
import org.seasar.doma.Sql
6
6
import org.seasar.doma.jdbc.Config
7
- import org.seasar.doma.kotlin.jdbc.criteria.KEntityql
7
+ import org.seasar.doma.kotlin.jdbc.criteria.KQueryDsl
8
8
import sample.domain.Name
9
9
import sample.entity.Department_
10
10
import sample.entity.Person
11
11
import sample.entity.Person_
12
12
13
13
@Dao
14
14
interface PersonDao {
15
- private val entityql
16
- get() = KEntityql (Config .get(this ))
15
+ private val queryDsl
16
+ get() = KQueryDsl (Config .get(this ))
17
17
18
18
@Sql(" select * from person where id = /*id*/0" )
19
19
@Select
@@ -27,7 +27,7 @@ interface PersonDao {
27
27
val p = Person_ ()
28
28
val d = Department_ ()
29
29
30
- return entityql .from(p).innerJoin(d) {
30
+ return queryDsl .from(p).innerJoin(d) {
31
31
eq(p.departmentId, d.id)
32
32
}.where {
33
33
eq(d.name, Name (departmentName))
@@ -38,19 +38,19 @@ interface PersonDao {
38
38
39
39
fun insert (person : Person ): Person {
40
40
val p = Person_ ()
41
- val result = entityql .insert(p, person).execute()
41
+ val result = queryDsl .insert(p).single( person).execute()
42
42
return result.entity
43
43
}
44
44
45
45
fun update (person : Person ): Person {
46
46
val p = Person_ ()
47
- val result = entityql .update(p, person).execute()
47
+ val result = queryDsl .update(p).single( person).execute()
48
48
return result.entity
49
49
}
50
50
51
51
fun delete (person : Person ): Person {
52
52
val p = Person_ ()
53
- val result = entityql .delete(p, person).execute()
53
+ val result = queryDsl .delete(p).single( person).execute()
54
54
return result.entity
55
55
}
56
56
}
0 commit comments