Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
J
java-60-2
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
narakorn vichianchai
java-60-2
Commits
0669b164
Commit
0669b164
authored
Apr 19, 2018
by
narakorn vichianchai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
การดึงข้อมูลจากฐานข้อมูล
parent
1f130707
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
+36
-0
create_model.txt
13-15-Project-Development/create_model.txt
+3
-0
step.txt
13-15-Project-Development/step.txt
+33
-0
No files found.
13-15-Project-Development/create_model.txt
0 → 100644
View file @
0669b164
create models Car.java form Company.java
- car еͧ import , @Entity , @Constraints.Required//躹÷ҧ
- delete conf->evolutions->default->1.sql ѹ sbt run ա駨 car sql
13-15-Project-Development/step.txt
0 → 100644
View file @
0669b164
1. ҧ models -> Course.java
2.
@Entity
public class Course {
@Id
public Long id;
public String title;
public String description;
public static Finder<Long, Course> find = new Finder<>(Course.class);
}
<Long, Course> find = new Finder<>(Course.class);
3. conf > evolutions > 2.sql insert into course (id,title,description) values ( 1,'Numertical Method', '');
delete from course;
4. ҧ CourseController.java
public Result course() {
List<Course> courseList = Course.find.all();
return ok(views.html.course.render(courseList));
}
5. ҧ course.scala.html
@(courseList: List[models.Course])
ǹ㹡ѹѾ
@for(c <- courseList) {
<tr>
<td>@c.id</td>
<td>@c.title</td>
<td>@c.description</td>
</tr>
}
6. routes
GET /course controllers.CourseController.course()
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