Advertisement
Guest User

Untitled

a guest
Apr 5th, 2015
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. package modelo;
  2. import java.io.Serializable;
  3. import java.util.List;
  4. import javax.persistence.*;
  5.  
  6.  
  7. @Entity
  8. @Table (name="depto")
  9. public class Depto implements Serializable {
  10. @Id
  11. @Column(name="id")
  12. @GeneratedValue(strategy = GenerationType.IDENTITY)
  13. private Long id;
  14.  
  15. @Column(length=50)
  16. private String nome;
  17.  
  18. public Long getId() {
  19. return id;
  20. }
  21.  
  22. public void setId(Long id) {
  23. this.id = id;
  24. }
  25.  
  26. public String getNome() {
  27. return nome;
  28. }
  29.  
  30. public void setNome(String nome) {
  31. this.nome = nome;
  32. }
  33. @OneToMany (mappedBy="depto")
  34. private List<Funcionario> funcionarios;
  35.  
  36. public List<Funcionario> getFuncionarios() {
  37. return funcionarios;
  38. }
  39.  
  40. public void setFuncionarios(List<Funcionario> funcionarios) {
  41. this.funcionarios = funcionarios;
  42. }
  43.  
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement