-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create MODELS for products and repair
- Loading branch information
1 parent
8aaa625
commit adc7c23
Showing
10 changed files
with
208 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/main/java/ua/pp/fairwind/favorid/internalDB/model/products/Product.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package ua.pp.fairwind.favorid.internalDB.model.products; | ||
|
||
import ua.pp.fairwind.favorid.internalDB.model.Document; | ||
import ua.pp.fairwind.favorid.internalDB.model.storehouses.Nomenclature; | ||
|
||
import javax.persistence.*; | ||
import java.util.Date; | ||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
/** | ||
* Created by Ñåðãåé on 15.10.2015. | ||
*/ | ||
@Entity | ||
@Table(name = "PRODUCTS") | ||
public class Product { | ||
@Id | ||
@GeneratedValue | ||
Long id; | ||
@ManyToOne | ||
@JoinColumn(name = "nomenclature_ID") | ||
Nomenclature nomenclature; | ||
String serial_number; | ||
boolean self_created=false; | ||
String description; | ||
@OneToMany | ||
Set<Document> productDocuments=new HashSet<>(); | ||
@ManyToOne | ||
@JoinColumn(name = "composed_ID") | ||
Product composedOf; | ||
@OneToMany(mappedBy = "composedOf") | ||
Set<Product> composition=new HashSet<>(); | ||
Date createdDate; | ||
Date shippingDate; | ||
Date guaranteePeriod; | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/ua/pp/fairwind/favorid/internalDB/model/products/REPAIR_STATUS.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package ua.pp.fairwind.favorid.internalDB.model.products; | ||
|
||
/** | ||
* Created by Ñåðãåé on 15.10.2015. | ||
*/ | ||
public enum REPAIR_STATUS { | ||
ENTRY, | ||
TROUBLESHOOTING, | ||
WAITING_FOR_PARTS, | ||
REJECTED, | ||
RESTORED, | ||
SENT_TO_MANUFACTURER, | ||
SERVICE | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/ua/pp/fairwind/favorid/internalDB/model/products/Repair.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package ua.pp.fairwind.favorid.internalDB.model.products; | ||
|
||
import javax.persistence.*; | ||
import java.util.Date; | ||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
/** | ||
* Created by Ñåðãåé on 15.10.2015.repairs | ||
*/ | ||
@Entity | ||
@Table(name = "REPAIRS") | ||
public class Repair { | ||
@Id | ||
@GeneratedValue | ||
Long id; | ||
@ManyToOne | ||
@JoinColumn(name = "product_ID") | ||
Product product; | ||
String description; | ||
String repairResult; | ||
REPAIR_STATUS status; | ||
Date start=new Date(); | ||
Date end; | ||
Date lastStatusChange; | ||
@OneToMany(mappedBy = "repair") | ||
Set<RepairIteration> repairIteration=new HashSet<>(); | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/ua/pp/fairwind/favorid/internalDB/model/products/RepairIteration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package ua.pp.fairwind.favorid.internalDB.model.products; | ||
|
||
import javax.persistence.*; | ||
import java.util.Date; | ||
|
||
/** | ||
* Created by Ñåðãåé on 15.10.2015. | ||
*/ | ||
@Entity | ||
public class RepairIteration { | ||
@Id | ||
@GeneratedValue | ||
Long id; | ||
@ManyToOne | ||
@JoinColumn(name = "repair_ID") | ||
Repair repair; | ||
REPAIR_STATUS status; | ||
String description; | ||
Date created=new Date(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters