Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE public.covek
- (
- maticen_broj varchar(13) NOT NULL,
- ime_i_prezime varchar(50) NULL,
- datum_na_ragjanje date nUll,
- username varchar(20) NOT NULL,
- password varchar(20) NOT NULL,
- tip_pacient bool NOT NULL,
- tip_lekar bool NOT NULL,
- pol varchar(1) NULL,
- PRIMARY KEY (maticen_broj),
- UNIQUE (username, maticen_broj)
- )
- CREATE TABLE public.lekar
- (
- reden_broj_lekar bigserial NOT null,
- maticen_broj varchar(13) references covek(maticen_broj),
- tip varchar(1) NULL,
- PRIMARY KEY (reden_broj_lekar)
- )
- import java.util.Date;
- import javax.persistence.Column;
- import javax.persistence.Entity;
- import javax.persistence.Id;
- import javax.persistence.Table;
- import javax.persistence.Temporal;
- import javax.persistence.TemporalType;
- import javax.persistence.UniqueConstraint;
- /**
- * Covek generated by hbm2java
- */
- @Entity
- @Table(name = "covek", schema = "public", uniqueConstraints = @UniqueConstraint(columnNames = { "username", "maticen_broj" }))
- public class Covek implements java.io.Serializable {
- private String maticenBroj;
- private String imeIPrezime;
- private Date datumNaRagjanje;
- private String username;
- private String password;
- private boolean tipPacient;
- private boolean tipLekar;
- private String pol;
- public Covek() {
- }
- public Covek(String maticenBroj, String username, String password, boolean tipPacient, boolean tipLekar) {
- this.maticenBroj = maticenBroj;
- this.username = username;
- this.password = password;
- this.tipPacient = tipPacient;
- this.tipLekar = tipLekar;
- }
- public Covek(String maticenBroj, String imeIPrezime, Date datumNaRagjanje, String username, String password,
- boolean tipPacient, boolean tipLekar, String pol) {
- this.maticenBroj = maticenBroj;
- this.imeIPrezime = imeIPrezime;
- this.datumNaRagjanje = datumNaRagjanje;
- this.username = username;
- this.password = password;
- this.tipPacient = tipPacient;
- this.tipLekar = tipLekar;
- this.pol = pol;
- }
- @Id
- @Column(name = "maticen_broj", unique = true, nullable = false, length = 13)
- public String getMaticenBroj() {
- return this.maticenBroj;
- }
- public void setMaticenBroj(String maticenBroj) {
- this.maticenBroj = maticenBroj;
- }
- @Column(name = "ime_i_prezime", length = 50)
- public String getImeIPrezime() {
- return this.imeIPrezime;
- }
- public void setImeIPrezime(String imeIPrezime) {
- this.imeIPrezime = imeIPrezime;
- }
- @Temporal(TemporalType.DATE)
- @Column(name = "datum_na_ragjanje", length = 13)
- public Date getDatumNaRagjanje() {
- return this.datumNaRagjanje;
- }
- public void setDatumNaRagjanje(Date datumNaRagjanje) {
- this.datumNaRagjanje = datumNaRagjanje;
- }
- @Column(name = "username", nullable = false, length = 20)
- public String getUsername() {
- return this.username;
- }
- public void setUsername(String username) {
- this.username = username;
- }
- @Column(name = "password", nullable = false, length = 20)
- public String getPassword() {
- return this.password;
- }
- public void setPassword(String password) {
- this.password = password;
- }
- @Column(name = "tip_pacient", nullable = false)
- public boolean isTipPacient() {
- return this.tipPacient;
- }
- public void setTipPacient(boolean tipPacient) {
- this.tipPacient = tipPacient;
- }
- @Column(name = "tip_lekar", nullable = false)
- public boolean isTipLekar() {
- return this.tipLekar;
- }
- public void setTipLekar(boolean tipLekar) {
- this.tipLekar = tipLekar;
- }
- @Column(name = "pol", length = 1)
- public String getPol() {
- return this.pol;
- }
- public void setPol(String pol) {
- this.pol = pol;
- }
- }
- import javax.persistence.Column;
- import javax.persistence.Entity;
- import javax.persistence.Id;
- import javax.persistence.Table;
- /**
- * Lekar generated by hbm2java
- */
- @Entity
- @Table(name = "lekar", schema = "public")
- public class Lekar implements java.io.Serializable {
- private long redenBrojLekar;
- private String maticenBroj;
- private String tip;
- public Lekar() {
- }
- public Lekar(long redenBrojLekar) {
- this.redenBrojLekar = redenBrojLekar;
- }
- public Lekar(long redenBrojLekar, String maticenBroj, String tip) {
- this.redenBrojLekar = redenBrojLekar;
- this.maticenBroj = maticenBroj;
- this.tip = tip;
- }
- @Id
- @Column(name = "reden_broj_lekar", unique = true, nullable = false)
- public long getRedenBrojLekar() {
- return this.redenBrojLekar;
- }
- public void setRedenBrojLekar(long redenBrojLekar) {
- this.redenBrojLekar = redenBrojLekar;
- }
- @Column(name = "maticen_broj", length = 13)
- public String getMaticenBroj() {
- return this.maticenBroj;
- }
- public void setMaticenBroj(String maticenBroj) {
- this.maticenBroj = maticenBroj;
- }
- @Column(name = "tip", length = 1)
- public String getTip() {
- return this.tip;
- }
- public void setTip(String tip) {
- this.tip = tip;
- }
- }
Add Comment
Please, Sign In to add comment