-
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.
- Loading branch information
Showing
130 changed files
with
1,668 additions
and
730 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/target/ |
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
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,67 @@ | ||
package com.gentian.e.voting.entities; | ||
|
||
import java.io.Serializable; | ||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.Id; | ||
import javax.persistence.Table; | ||
|
||
/** | ||
* | ||
* @author Gentian | ||
*/ | ||
@Entity | ||
@Table(name = "adresat") | ||
public class Address implements Serializable { | ||
|
||
private static final long serialVersionUID = 42L; | ||
|
||
// <editor-fold defaultstate="collapsed" desc="Property Id"> | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "adresa_id") | ||
private Long _id; | ||
|
||
public Long getId() { | ||
return _id; | ||
} | ||
|
||
public void setId(Long id) { | ||
_id = id; | ||
} | ||
// </editor-fold> | ||
|
||
// <editor-fold defaultstate="collapsed" desc="Property Name"> | ||
@Column(name = "adresa_emri") | ||
private String _name; | ||
|
||
public String getName() { | ||
return _name; | ||
} | ||
|
||
public void setName(String name) { | ||
_name = name; | ||
} | ||
// </editor-fold> | ||
|
||
// <editor-fold defaultstate="collapsed" desc="Property City Id"> | ||
@Column(name = "adresa_qyteti_id") | ||
private Long _cityId; | ||
|
||
public Long getCityId() { | ||
return _cityId; | ||
} | ||
|
||
public void setCityId(Long cityId) { | ||
_cityId = cityId; | ||
} | ||
// </editor-fold> | ||
|
||
@Override | ||
public String toString() { | ||
return "Adresat[ id=" + _id + ", Emri=" + _name + ", QytetiId=" + _cityId + " ]"; | ||
} | ||
|
||
} |
101 changes: 43 additions & 58 deletions
101
src/main/java/com/gentian/e/voting/entities/Candidate.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 |
---|---|---|
@@ -1,113 +1,98 @@ | ||
package com.gentian.e.voting.entities; | ||
|
||
import java.io.Serializable; | ||
import java.util.Objects; | ||
import java.util.Date; | ||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.Id; | ||
import javax.persistence.Table; | ||
import javax.persistence.Temporal; | ||
|
||
/** | ||
* | ||
* @author Gentian | ||
*/ | ||
@Entity | ||
@Table(name = "candidates") | ||
@Table(name = "kandidatet") | ||
public class Candidate implements Serializable { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
// <editor-fold defaultstate="collapsed" desc="Property Id"> | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "candidate_id") | ||
private Long _id; | ||
@Column(name = "kandidati_id") | ||
private int _id; | ||
|
||
public Long getId() { | ||
public int getId() { | ||
return _id; | ||
} | ||
|
||
public void setId(Long id) { | ||
_id = id; | ||
public void setId(int id) { | ||
_id= id; | ||
} | ||
// </editor-fold> | ||
|
||
// <editor-fold defaultstate="collapsed" desc="Property First Name"> | ||
@Column(name = "kandidati_emri") | ||
private String _firstName; | ||
|
||
// <editor-fold defaultstate="collapsed" desc="Property Candidate Name"> | ||
@Column(name = "candidate_name") | ||
private String _candidateName = ""; | ||
|
||
public String getCandidateName() { | ||
return _candidateName; | ||
public String getFirstName() { | ||
return _firstName; | ||
} | ||
|
||
public void setCandidateName(String _candidateName) { | ||
this._candidateName = _candidateName; | ||
public void setFirstName(String firstName) { | ||
_firstName = firstName; | ||
} | ||
// </editor-fold> | ||
|
||
// <editor-fold defaultstate="collapsed" desc="Property Candidate Number"> | ||
@Column(name = "candidate_number") | ||
private int _candidateNumber = -1; | ||
public int getCandidateNumber() { | ||
return _candidateNumber; | ||
// <editor-fold defaultstate="collapsed" desc="Property Last Name"> | ||
@Column(name = "kandidati_mbiemri") | ||
private String _lastName; | ||
|
||
public String getLastName() { | ||
return _lastName; | ||
} | ||
|
||
public void setCandidateNumber(int candidateNumber) { | ||
this._candidateNumber = candidateNumber; | ||
public void setLastName(String lastName) { | ||
_lastName = lastName; | ||
} | ||
// </editor-fold> | ||
|
||
// <editor-fold defaultstate="collapsed" desc="Property Candidate Subject Number"> | ||
@Column(name = "candidate_subject_number") | ||
private int _candidateSubjectNumber = -1; | ||
// <editor-fold defaultstate="collapsed" desc="Property Birthday"> | ||
@Column(name = "kandidati_datelindja") | ||
@Temporal(javax.persistence.TemporalType.DATE) | ||
private Date _birthday; | ||
|
||
public int getCandidateSubjectNumber() { | ||
return _candidateSubjectNumber; | ||
public Date getBirthday() { | ||
return _birthday; | ||
} | ||
|
||
public void setCandidateSubjectNumber(int candidateSubjectNumber) { | ||
this._candidateSubjectNumber = candidateSubjectNumber; | ||
public void setBirthday(Date birthday) { | ||
_birthday = birthday; | ||
} | ||
// </editor-fold> | ||
|
||
// <editor-fold defaultstate="collapsed" desc="Property Candidate Number Of Votes"> | ||
@Column(name = "candidate_number_of_votes") | ||
private long _candidateNumberOfVotes; | ||
// <editor-fold defaultstate="collapsed" desc="Property Email"> | ||
@Column(name = "kandidati_emaili") | ||
private String _email; | ||
|
||
public long getCandidateNumberOfVotes() { | ||
return _candidateNumberOfVotes; | ||
public String getEmail() { | ||
return _email; | ||
} | ||
|
||
public void setCandidateNumberOfVotes(long candidateNumberOfVotes) { | ||
_candidateNumberOfVotes = candidateNumberOfVotes; | ||
public void setEmail(String email) { | ||
_email = email; | ||
} | ||
// </editor-fold> | ||
|
||
// <editor-fold defaultstate="collapsed" desc="hashcode / equals / toString"> | ||
@Override | ||
public int hashCode() { | ||
int hash = 0; | ||
hash += _id; | ||
return hash; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object object) { | ||
// TODO: Warning - this method won't work in the case the id fields are not set | ||
if (!(object instanceof Candidate)) { | ||
return false; | ||
} | ||
Candidate other = (Candidate) object; | ||
return Objects.equals(_id, other.getId()); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "com.gentian.e.voting.entities.Candidates[ id=" + _id + " ]"; | ||
return "Kandidati[ Id=" + _id + ", " | ||
+ "Emri=" + _firstName + ", " | ||
+ "Mbiemri=" + _lastName + " ]"; | ||
} | ||
// </editor-fold> | ||
|
||
} |
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,54 @@ | ||
package com.gentian.e.voting.entities; | ||
|
||
import java.io.Serializable; | ||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.Id; | ||
import javax.persistence.Table; | ||
|
||
/** | ||
* | ||
* @author Gentian | ||
*/ | ||
@Entity | ||
@Table(name = "qytetet") | ||
public class City implements Serializable { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
// <editor-fold defaultstate="collapsed" desc="Property Id"> | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "qyteti_id") | ||
private Long _id; | ||
|
||
public Long getId() { | ||
return _id; | ||
} | ||
|
||
public void setId(Long id) { | ||
_id = id; | ||
} | ||
// </editor-fold> | ||
|
||
// <editor-fold defaultstate="collapsed" desc="Property Name"> | ||
@Column(name = "qyteti_emri") | ||
private String _name; | ||
|
||
public String getName() { | ||
return _name; | ||
} | ||
|
||
public void setName(String name) { | ||
_name = name; | ||
} | ||
// </editor-fold> | ||
|
||
@Override | ||
public String toString() { | ||
return "Qyteti[ Id=" + _id + ", Emri=" + _name +" ]"; | ||
} | ||
|
||
} |
Oops, something went wrong.