package no.hvl.dat250.jpa.basicexample;
import javax.persistence.*;
import java.util.List;
public class Person {
@Id
@GeneratedValue(strategy = GenerationType.TABLE)
private List<Address> adresses;
this.name = name;
}
@Embedded
private Address address;
@Embedded
private CreditCard creditCard;
public Person() {
}
public void setAddress(Address address) {
this.adresses.add(address);
}
public void setName
(String name
){
this.name = name;
}
return name;
}
return id;
}
public void setId
(Long Id
) {
this.id = Id;
}
}
package no.hvl.dat250.jpa.basicexample;
import javax.persistence.*;
@Embeddable
public class CreditCard {
@Id
@GeneratedValue(strategy = GenerationType.TABLE)
private int id;
private int number;
private int limit;
private int balance;
private Bank bank;
@Embedded
private Pincode pincode;
}
package no.hvl.dat250.jpa.basicexample;
import javax.persistence.*;
public class Bank {
@Id
@GeneratedValue(strategy = GenerationType.TABLE)
private int id;
}
package no.hvl.dat250.jpa.basicexample;
import javax.persistence.Embeddable;
@Embeddable
public class Pincode {
private int count;
public Pincode(){
}
return pincode;
}
public void setPincode
(String pincode
) {
this.pincode = pincode;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
}
package no.hvl.dat250.jpa.basicexample;
import javax.persistence.Embeddable;
import javax.persistence.*;
@Embeddable
public class Address {
@Id
@GeneratedValue(strategy = GenerationType.TABLE)
private int number;
public Address() {
}
public void setStreet
(String street
) {
this.street = street;
}
return street;
}
public int getNumber() {
return number;
}
public void setNumber(int number) {
this.number = number;
}
return id;
}
public void setId
(Long Id
) {
this.id = Id;
}
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}