Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
M
mywork
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sumet
mywork
Commits
91224be1
Commit
91224be1
authored
May 01, 2018
by
sumet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
9444a934
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
44 deletions
+32
-44
HomeController.java
play-java-ebean-example/app/controllers/HomeController.java
+0
-9
1.sql
play-java-ebean-example/conf/evolutions/default/1.sql
+32
-33
2.sql
play-java-ebean-example/conf/evolutions/default/2.sql
+0
-0
routes
play-java-ebean-example/conf/routes
+0
-2
No files found.
play-java-ebean-example/app/controllers/HomeController.java
View file @
91224be1
package
controllers
;
import
models.Computer
;
import
models.Thai
;
import
play.data.Form
;
import
play.data.FormFactory
;
import
play.libs.concurrent.HttpExecutionContext
;
...
...
@@ -13,8 +12,6 @@ import repository.ComputerRepository;
import
javax.inject.Inject
;
import
javax.persistence.PersistenceException
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.CompletionStage
;
...
...
@@ -53,12 +50,6 @@ public class HomeController extends Controller {
return
GO_HOME
;
}
public
Result
thai
(){
List
<
Thai
>
Thailand
=
new
ArrayList
<>();
Thailand
=
Thai
.
find
.
all
();
return
ok
(
views
.
html
.
thai
.
render
(
Thailand
));
}
/**
* Display the paginated list of computers.
*
...
...
play-java-ebean-example/conf/evolutions/default/1.sql
View file @
91224be1
#
--- Created by Ebean DDL
#
To
stop
Ebean
DDL
generation
,
remove
this
comment
and
start
using
Evolutions
#
--- !Ups
#
--- First database schema
#
--- !Ups
create
table
company
(
id
bigint
auto_increme
nt
not
null
,
name
varchar
(
255
),
constraint
pk_company
primary
key
(
id
)
)
;
id
bigi
nt
not
null
,
name
varchar
(
255
),
constraint
pk_company
primary
key
(
id
)
)
;
create
table
computer
(
id
bigint
auto_increment
not
null
,
name
varchar
(
255
),
introduced
timestamp
,
discontinued
timestamp
,
company_id
bigint
,
constraint
pk_computer
primary
key
(
id
)
);
create
table
thai
(
id
bigint
auto_increment
not
null
,
coun
varchar
(
255
),
prov
varchar
(
255
),
constraint
pk_thai
primary
key
(
id
)
);
alter
table
computer
add
constraint
fk_computer_company_id
foreign
key
(
company_id
)
references
company
(
id
)
on
delete
restrict
on
update
restrict
;
create
index
ix_computer_company_id
on
computer
(
company_id
);
#
--- !Downs
alter
table
computer
drop
constraint
if
exists
fk_computer_company_id
;
drop
index
if
exists
ix_computer_company_id
;
id
bigint
not
null
,
name
varchar
(
255
),
introduced
timestamp
,
discontinued
timestamp
,
company_id
bigint
,
constraint
pk_computer
primary
key
(
id
))
;
create
sequence
company_seq
start
with
1000
;
create
sequence
computer_seq
start
with
1000
;
alter
table
computer
add
constraint
fk_computer_company_1
foreign
key
(
company_id
)
references
company
(
id
)
on
delete
restrict
on
update
restrict
;
create
index
ix_computer_company_1
on
computer
(
company_id
);
#
--- !Downs
SET
REFERENTIAL_INTEGRITY
FALSE
;
drop
table
if
exists
company
;
drop
table
if
exists
computer
;
drop
table
if
exists
thai
;
SET
REFERENTIAL_INTEGRITY
TRUE
;
drop
sequence
if
exists
company_seq
;
drop
sequence
if
exists
computer_seq
;
play-java-ebean-example/conf/evolutions/default/2.sql
View file @
91224be1
This diff is collapsed.
Click to expand it.
play-java-ebean-example/conf/routes
View file @
91224be1
...
...
@@ -5,8 +5,6 @@
# Default path will just redirect to the computer list
GET / controllers.HomeController.index()
GET /thai controllers.HomeController.thai()
# Computers list (look at the default values for pagination parameters)
GET /computers controllers.HomeController.list(p:Int ?= 0, s ?= "name", o ?= "asc", f ?= "")
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment