Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package DB;
- 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.JoinColumn;
- import javax.persistence.ManyToOne;
- import javax.persistence.Table;
- @Entity
- @Table(name = "Currency")
- public class Currency implements Serializable {
- @Id
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- @Column(name = "id")
- Long id;
- @Column(name = "ShortName", nullable = false, length = 10)
- private String shortname;
- @Column(name = "FullName", nullable = false, length = 50)
- private String fullname;
- @Column(name = "Unit", nullable = false, length = 50)
- private String unit;
- @Column(name = "Symbol", nullable = true, length = 10)
- private String symbol;
- @ManyToOne
- @JoinColumn(name = "country_id")
- private int country;
- public Currency() {
- }
- public Currency(String shortname, String fullname, int country) {
- this.shortname = shortname;
- this.fullname = fullname;
- this.country = country;
- }
- public Currency(String shortname, String fullname, int country, String unit) {
- this.shortname = shortname;
- this.fullname = fullname;
- this.country = country;
- this.unit = unit;
- }
- public Long getId() {
- return id;
- }
- public void setId(Long id) {
- this.id = id;
- }
- public String getShortName() {
- return shortname;
- }
- public void setShortName(String shortname) {
- this.shortname = shortname;
- }
- public String getFullName() {
- return fullname;
- }
- public void setFullName(String fullname) {
- this.fullname = fullname;
- }
- public String getUnit() {
- return unit;
- }
- public void setUnit(String unit) {
- this.unit = unit;
- }
- public String getSymbol() {
- return symbol;
- }
- public void setSymbol(String symbol) {
- this.symbol = symbol;
- }
- public int getCountry() {
- return country;
- }
- public void setCountry(int country) {
- this.country = country;
- }
- @Override
- public String toString() {
- return "\n\nCurrency: \n id=" + id + "\n sShortname: " + shortname + "\n Fullname: " + fullname
- + "\n Unit: " + unit + "\n Symbol: " + symbol+ "\n Country: " + country +" ";
- }
- }
Add Comment
Please, Sign In to add comment