Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
E
Ecsite
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
shoei.kanno
Ecsite
Commits
fcb099e8
Commit
fcb099e8
authored
Oct 16, 2020
by
keita.onoguchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shoesテーブルのEntity追加
parent
4e78b81d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
0 deletions
+76
-0
SalesLog.java
src/main/java/com/example/domain/SalesLog.java
+5
-0
Shoes.java
src/main/java/com/example/domain/Shoes.java
+31
-0
ShoesRepository.java
src/main/java/com/example/repository/ShoesRepository.java
+9
-0
ShoesService.java
src/main/java/com/example/service/ShoesService.java
+31
-0
No files found.
src/main/java/com/example/domain/SalesLog.java
0 → 100644
View file @
fcb099e8
package
com
.
example
.
domain
;
public
class
SalesLog
{
}
src/main/java/com/example/domain/Shoes.java
0 → 100644
View file @
fcb099e8
package
com
.
example
.
domain
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
lombok.Getter
;
import
lombok.Setter
;
//shoesのentityクラス
@Entity
@Setter
@Getter
@Table
(
name
=
"shoes"
)
public
class
Shoes
{
@Id
@GeneratedValue
private
Integer
Id
;
@Column
(
nullable
=
false
)
private
String
Name
;
@Column
(
nullable
=
false
)
private
Integer
Price
;
@Column
(
nullable
=
false
)
private
Integer
Stock
;
@Column
(
nullable
=
false
)
private
Integer
Size
;
@Column
(
nullable
=
false
)
private
Integer
productStatus
;
}
src/main/java/com/example/repository/ShoesRepository.java
0 → 100644
View file @
fcb099e8
package
com
.
example
.
repository
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
com.example.domain.Shoes
;
public
interface
ShoesRepository
extends
JpaRepository
<
Shoes
,
Integer
>{
}
src/main/java/com/example/service/ShoesService.java
0 → 100644
View file @
fcb099e8
package
com
.
example
.
service
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.example.domain.Shoes
;
import
com.example.repository.ShoesRepository
;
@Service
public
class
ShoesService
{
@Autowired
ShoesRepository
shoesRepository
;
public
List
<
Shoes
>
findAll
(){
return
shoesRepository
.
findAll
();
}
public
Shoes
findOne
(
Integer
id
){
return
shoesRepository
.
findOne
(
id
);
}
public
Shoes
create
(
Shoes
shoes
){
return
shoesRepository
.
save
(
shoes
);
}
public
Shoes
update
(
Shoes
shoes
){
return
shoesRepository
.
save
(
shoes
);
}
}
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