Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
drop sequence employee_seq;
drop table employee;
drop table department;

drop table if exists review;
drop table if exists payment;
drop table if exists order_item;
drop table if exists "order";
drop table if exists product_category;
drop table if exists category;
drop table if exists product;
drop table if exists user_role;
drop table if exists role;
drop table if exists "user";
DROP sequence employee_seq ;
DROP TABLE employee ;
DROP TABLE department ;
DROP TABLE IF EXISTS review ;
DROP TABLE IF EXISTS payment ;
DROP TABLE IF EXISTS order_item ;
DROP TABLE IF EXISTS "order" ;
DROP TABLE IF EXISTS product_category ;
DROP TABLE IF EXISTS category ;
DROP TABLE IF EXISTS product ;
DROP TABLE IF EXISTS user_role ;
DROP TABLE IF EXISTS role ;
DROP TABLE IF EXISTS "user" ;
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
@Dao
public interface CircleZoneDao {

@Sql("select /*%expand */* from circle_zone where id = /* id */0")
@Sql(
"""
SELECT /*%expand */*
FROM circle_zone
WHERE id = /* id */0
""")
@Select
CircleZone selectById(Integer id);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
@Dao
public interface LandmarkDao {

@Sql("select /*%expand */* from landmark where id = /* id */0")
@Sql(
"""
SELECT /*%expand */*
FROM landmark
WHERE id = /* id */0
""")
@Select
Landmark selectById(Integer id);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
CREATE TABLE landmark (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
location POINT NOT NULL
);

CREATE TABLE circle_zone (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
boundary CIRCLE NOT NULL
);
CREATE TABLE landmark
(
id INTEGER PRIMARY KEY
, name TEXT NOT NULL
, location POINT NOT NULL
) ;
CREATE TABLE circle_zone
(
id INTEGER PRIMARY KEY
, name TEXT NOT NULL
, boundary CIRCLE NOT NULL
) ;
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
DROP TABLE landmark;
DROP TABLE circle_zone;
DROP TABLE landmark ;
DROP TABLE circle_zone ;
11 changes: 4 additions & 7 deletions example-jpms/src/main/java/example/jpms/dao/EmployeeDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,10 @@ public interface EmployeeDao {

@Sql(
"""
select
/*%expand*/*
from
employee
where
id = /* id */0
""")
SELECT /*%expand*/*
FROM employee
WHERE id = /* id */0
""")
@Select
Employee selectById(Integer id);
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,185 @@
create sequence employee_seq start with 100 increment by 1;
create table department (id integer not null primary key,name varchar(255) not null, version integer not null);
create table employee (id integer not null primary key,name varchar(255) not null,age integer not null,salary integer,job_type varchar(20),hiredate timestamp, department_id integer, version integer not null, insertTimestamp timestamp, updateTimestamp timestamp);
insert into department values(1,'ACCOUNTING',1);
insert into department values(2,'RESEARCH',1);
insert into department values(3,'SALES',1);
insert into employee values(1,'ALLEN',30,1600,'SALESMAN','2008-01-20 12:34:56',1,1,CURRENT_TIMESTAMP,null);
insert into employee values(2,'WARD',32,1250,'ANALYST','2008-02-20 12:34:56',2,1,CURRENT_TIMESTAMP,null);
insert into employee values(3,'JONES',38,2975,'MANAGER','2008-03-20 12:34:56',3,1,CURRENT_TIMESTAMP,null);
insert into employee values(4,'MARTIN',40,1250,'SALESMAN','2008-04-20 12:34:56',1,1,CURRENT_TIMESTAMP,null);
insert into employee values(5,'BLAKE',50,2850,'SALESMAN','2008-05-20 12:34:56',2,1,CURRENT_TIMESTAMP,null);
insert into employee values(6,'CLARK',23,2450,'MANAGER','2008-06-20 12:34:56',3,1,CURRENT_TIMESTAMP,null);
insert into employee values(7,'SCOTT',28,3000,'SALESMAN','2008-07-20 12:34:56',1,1,CURRENT_TIMESTAMP,null);
insert into employee values(8,'KING',38,5000,'CLERK','2008-08-20 12:34:56',2,1,CURRENT_TIMESTAMP,null);
insert into employee values(9,'TURNER',33,1500,'ANALYST','2008-09-20 12:34:56',3,1,CURRENT_TIMESTAMP,null);
insert into employee values(10,'ADAMS',62,1100,'SALESMAN','2008-10-20 12:34:56',1,1,CURRENT_TIMESTAMP,null);
insert into employee values(11,'JAMES',44,950,'CLERK','2008-11-20 12:34:56',2,1,CURRENT_TIMESTAMP,null);
insert into employee values(12,'FORD',55,3000,'ANALYST','2008-12-20 12:34:56',3,1,CURRENT_TIMESTAMP,null);
insert into employee values(13,'MILLER',51,1300,'MANAGER','2009-01-20 12:34:56',1,1,CURRENT_TIMESTAMP,null);
insert into employee values(14,'SMITH',410,800,'PRESIDENT','2009-02-20 12:34:56',2,1,CURRENT_TIMESTAMP,null);
CREATE sequence employee_seq start
WITH 100 increment BY 1 ;
CREATE TABLE department
( id integer NOT NULL PRIMARY KEY
, name varchar(255) NOT NULL
, version integer NOT NULL
) ;
CREATE TABLE employee
( id integer NOT NULL PRIMARY KEY
, name varchar(255) NOT NULL
, age integer NOT NULL
, salary integer
, job_type varchar(20)
, hiredate timestamp
, department_id integer
, version integer NOT NULL
, insertTimestamp timestamp
, updateTimestamp timestamp
) ;
INSERT INTO department
VALUES ( 1
, 'ACCOUNTING'
, 1 ) ;
INSERT INTO department
VALUES ( 2
, 'RESEARCH'
, 1 ) ;
INSERT INTO department
VALUES ( 3
, 'SALES'
, 1 ) ;
INSERT INTO employee
VALUES ( 1
, 'ALLEN'
, 30
, 1600
, 'SALESMAN'
, '2008-01-20 12:34:56'
, 1
, 1
, CURRENT_TIMESTAMP
, NULL ) ;
INSERT INTO employee
VALUES ( 2
, 'WARD'
, 32
, 1250
, 'ANALYST'
, '2008-02-20 12:34:56'
, 2
, 1
, CURRENT_TIMESTAMP
, NULL ) ;
INSERT INTO employee
VALUES ( 3
, 'JONES'
, 38
, 2975
, 'MANAGER'
, '2008-03-20 12:34:56'
, 3
, 1
, CURRENT_TIMESTAMP
, NULL ) ;
INSERT INTO employee
VALUES ( 4
, 'MARTIN'
, 40
, 1250
, 'SALESMAN'
, '2008-04-20 12:34:56'
, 1
, 1
, CURRENT_TIMESTAMP
, NULL ) ;
INSERT INTO employee
VALUES ( 5
, 'BLAKE'
, 50
, 2850
, 'SALESMAN'
, '2008-05-20 12:34:56'
, 2
, 1
, CURRENT_TIMESTAMP
, NULL ) ;
INSERT INTO employee
VALUES ( 6
, 'CLARK'
, 23
, 2450
, 'MANAGER'
, '2008-06-20 12:34:56'
, 3
, 1
, CURRENT_TIMESTAMP
, NULL ) ;
INSERT INTO employee
VALUES ( 7
, 'SCOTT'
, 28
, 3000
, 'SALESMAN'
, '2008-07-20 12:34:56'
, 1
, 1
, CURRENT_TIMESTAMP
, NULL ) ;
INSERT INTO employee
VALUES ( 8
, 'KING'
, 38
, 5000
, 'CLERK'
, '2008-08-20 12:34:56'
, 2
, 1
, CURRENT_TIMESTAMP
, NULL ) ;
INSERT INTO employee
VALUES ( 9
, 'TURNER'
, 33
, 1500
, 'ANALYST'
, '2008-09-20 12:34:56'
, 3
, 1
, CURRENT_TIMESTAMP
, NULL ) ;
INSERT INTO employee
VALUES ( 10
, 'ADAMS'
, 62
, 1100
, 'SALESMAN'
, '2008-10-20 12:34:56'
, 1
, 1
, CURRENT_TIMESTAMP
, NULL ) ;
INSERT INTO employee
VALUES ( 11
, 'JAMES'
, 44
, 950
, 'CLERK'
, '2008-11-20 12:34:56'
, 2
, 1
, CURRENT_TIMESTAMP
, NULL ) ;
INSERT INTO employee
VALUES ( 12
, 'FORD'
, 55
, 3000
, 'ANALYST'
, '2008-12-20 12:34:56'
, 3
, 1
, CURRENT_TIMESTAMP
, NULL ) ;
INSERT INTO employee
VALUES ( 13
, 'MILLER'
, 51
, 1300
, 'MANAGER'
, '2009-01-20 12:34:56'
, 1
, 1
, CURRENT_TIMESTAMP
, NULL ) ;
INSERT INTO employee
VALUES ( 14
, 'SMITH'
, 410
, 800
, 'PRESIDENT'
, '2009-02-20 12:34:56'
, 2
, 1
, CURRENT_TIMESTAMP
, NULL ) ;
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
drop sequence employee_seq;
drop table employee;
drop table department;
DROP sequence employee_seq ;
DROP TABLE employee ;
DROP TABLE department ;
2 changes: 1 addition & 1 deletion example-jpms/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
<logger name="org.seasar.doma.jdbc.LogKind.SQL.SCRIPT" level="off"/>

<root level="info">
<appender-ref ref="STDOUT" />
<appender-ref ref="STDOUT"/>
</root>
</configuration>
Loading