Skip to content

Commit

Permalink
refactor: Id tipo IDENTITY para postgres #64
Browse files Browse the repository at this point in the history
  • Loading branch information
tacianosilva committed Oct 7, 2022
1 parent eb2cbe8 commit fa5c081
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 49 deletions.
4 changes: 2 additions & 2 deletions src/main/java/br/ufrn/dct/apf/model/Attribution.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ public class Attribution implements Serializable {
* Regra para definir permissões membros de um projeto.
*/
public static final String PROJECT_MANAGER = "PROJECT MANAGER";

public static final String PROJECT_MEMBER = "PROJECT MEMBER";

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "attrib_id")
private int id;

Expand Down
30 changes: 15 additions & 15 deletions src/main/java/br/ufrn/dct/apf/model/DataFunction.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
* Internal Logical Files
* External Interface Files
*
* Data Functions are made up of internal and external resources
* Data Functions are made up of internal and external resources
* that affect the system.
*
*
* @author Taciano Morais Silva
* @since 04/04/2019
*/
Expand All @@ -33,11 +33,11 @@ public class DataFunction implements Serializable {
private static final long serialVersionUID = 1L;

public static final String TYPE_ILF = "TYPE_ILF";

public static final String TYPE_EIF = "TYPE_EIF";

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "data_id")
private Long id;

Expand All @@ -49,30 +49,30 @@ public class DataFunction implements Serializable {

/**
* number of Record Element Types (RET).
*
*
* A Record Element Type (RET) is the largest user identifiable subgroup
* of elements within an ILF or an EIF. It is best to look at logical
* of elements within an ILF or an EIF. It is best to look at logical
* groupings of data to help identify them.
*/
@Column(name = "ret")
private Long recordElementTypes;

/**
* number of Data Element Types (DET).
*
* Data Element Type (DET) is the data subgroup within an FTR.
*
* Data Element Type (DET) is the data subgroup within an FTR.
* They are unique and user identifiable.
*/
@Column(name = "det")
private Long dataElementTypes;

@Column(name = "description")
private String description;

@ManyToOne
@JoinColumn(name = "user_story_id", nullable = true)
private UserStory userStory;

@ManyToOne
@JoinColumn(name = "project_id", nullable = true)
private Project project;
Expand All @@ -91,7 +91,7 @@ public class DataFunction implements Serializable {
public static DataFunction createILF(String name) {
return new DataFunction(name, TYPE_ILF);
}

/**
* External Interface Files (EIF’s, in Portuguese, Arquivos Interface Externa - AIE's).
*
Expand All @@ -109,7 +109,7 @@ public static DataFunction createILF(String name) {
public static DataFunction createEIF(String name) {
return new DataFunction(name, TYPE_EIF);
}

public DataFunction() {}

private DataFunction(String name, String type) {
Expand Down Expand Up @@ -140,7 +140,7 @@ public String getType() {
public void setType(String type) {
this.type = type;
}

public String getDescription() {
return description;
}
Expand Down Expand Up @@ -184,7 +184,7 @@ public void setUserStory(UserStory us) {
public boolean isILF() {
return getType().equals(TYPE_ILF);
}

public boolean isEIF() {
return getType().equals(TYPE_EIF);
}
Expand Down Expand Up @@ -216,7 +216,7 @@ public boolean equals(Object obj) {
return other.name == null;
} else return name.equals(other.name);
}

@Override
public String toString() {
return "DataFunction@" + this.id + "@"+ this.type +"[" + this.name + "]";
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/br/ufrn/dct/apf/model/Member.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Member implements Serializable {
private static final long serialVersionUID = 1L;

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "member_id")
private Long id;

Expand All @@ -37,7 +37,7 @@ public class Member implements Serializable {
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "project_id", nullable = false)
private Project project;

@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "attrib_id", nullable = false)
private Attribution attribution;
Expand Down Expand Up @@ -70,7 +70,7 @@ public Project getProject() {
public void setProject(Project project) {
this.project = project;
}

public Attribution getAttribution() {
return attribution;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/br/ufrn/dct/apf/model/Project.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class Project implements Serializable {
private static final long serialVersionUID = 1L;

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "project_id")
private Long id;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/br/ufrn/dct/apf/model/Role.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Role implements Serializable {
public static final String ADMIN_ROLE = "ADMIN";

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "role_id")
private int id;

Expand Down
42 changes: 21 additions & 21 deletions src/main/java/br/ufrn/dct/apf/model/TransactionFunction.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
* External Inputs
* External Outputs
* External Inquiries
*
*
* Transaction functions are made up of the processes that are exchanged
* between the user, the external applications and the application being measured.
*
*
* https://www.tutorialspoint.com/estimation_techniques/estimation_techniques_function_points.htm
*
*
* @author Taciano Morais Silva
* @version 1.0
* @since 23/05/2019, 14h11m
Expand All @@ -40,27 +40,27 @@ public class TransactionFunction implements Serializable {
private static final long serialVersionUID = 1L;

/**
* External Input (EI) is a transaction function in which Data goes “into”
* the application from outside the boundary to inside. This data is coming
* External Input (EI) is a transaction function in which Data goes “into”
* the application from outside the boundary to inside. This data is coming
* external to the application.
*/
public static final String TYPE_EI = "TYPE_EI";

/**
* External Output (EO) is a transaction function in which data comes “out”
* of the system. Additionally, an EO may update an ILF. The data creates reports
* or output files sent to other applications.
*/
public static final String TYPE_EO = "TYPE_EO";

/**
* External Inquiry (EQ) is a transaction function
* with both input and output components that result in data retrieval.
*/
public static final String TYPE_EQ = "TYPE_EQ";

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "trans_id")
private Long id;

Expand All @@ -72,45 +72,45 @@ public class TransactionFunction implements Serializable {

/**
* number of File Type Referenced (FTR).
*
* File Type Referenced (FTR) is the largest user identifiable subgroup
*
* File Type Referenced (FTR) is the largest user identifiable subgroup
* within the EI, EO, or EQ that is referenced to.
*/
@Column(name = "ftr")
private Integer fileTypeReferenced;

/**
* number of Data Element Types (DET).
*
* Data Element Type (DET) is the data subgroup within an FTR.
*
* Data Element Type (DET) is the data subgroup within an FTR.
* They are unique and user identifiable.
*/
@Column(name = "det")
private Integer dataElementTypes;

@Column(name = "description")
private String description;

@ManyToOne
@JoinColumn(name = "user_story_id", nullable = true)
private UserStory userStory;

@ManyToOne
@JoinColumn(name = "project_id", nullable = true)
private Project project;

public static TransactionFunction createEI(String name) {
return new TransactionFunction(name, TYPE_EI);
}

public static TransactionFunction createEO(String name) {
return new TransactionFunction(name, TYPE_EO);
}

public static TransactionFunction createEQ(String name) {
return new TransactionFunction(name, TYPE_EQ);
}

public TransactionFunction() {}

private TransactionFunction(String name, String type) {
Expand Down Expand Up @@ -141,7 +141,7 @@ public String getType() {
public void setType(String type) {
this.type = type;
}

public String getDescription() {
return description;
}
Expand Down Expand Up @@ -185,11 +185,11 @@ public void setUserStory(UserStory us) {
public boolean isEI() {
return getType().equals(TYPE_EI);
}

public boolean isEO() {
return getType().equals(TYPE_EO);
}

public boolean isEQ() {
return getType().equals(TYPE_EQ);
}
Expand Down Expand Up @@ -224,7 +224,7 @@ public boolean equals(Object obj) {
return false;
return true;
}

@Override
public String toString() {
return "TransactionFunction@" + this.id + "@"+ this.type +"[" + this.name + "]";
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/br/ufrn/dct/apf/model/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class User implements Serializable {
private static final long serialVersionUID = 1L;

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "user_id")
private Long id;

Expand Down
10 changes: 5 additions & 5 deletions src/main/java/br/ufrn/dct/apf/model/UserStory.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class UserStory implements Serializable {
private static final long serialVersionUID = 1L;

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "user_story_id")
private Long id;

Expand All @@ -44,7 +44,7 @@ public class UserStory implements Serializable {

@OneToMany(mappedBy = "userStory", targetEntity = DataFunction.class, fetch = FetchType.EAGER)
private Set<DataFunction> dataFunctions = new HashSet<>();

@OneToMany(mappedBy = "userStory", targetEntity = TransactionFunction.class, fetch = FetchType.EAGER)
private Set<TransactionFunction> transactions = new HashSet<>();

Expand Down Expand Up @@ -105,15 +105,15 @@ public void addData(DataFunction data) {
dataFunctions.add(data);
}
}

public Set<TransactionFunction> getTransactionFunctions() {
return transactions;
}

public void setTransactionFunctions(Set<TransactionFunction> transactions) {
this.transactions = transactions;
}

public void addTransaction(TransactionFunction transaction) {
if (transaction != null) {
transaction.setUserStory(this);
Expand Down

0 comments on commit fa5c081

Please sign in to comment.