Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package modelo;
- import java.io.Serializable;
- import java.util.List;
- import javax.persistence.*;
- @Entity
- @Table (name="depto")
- public class Depto implements Serializable {
- @Id
- @Column(name="id")
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- private Long id;
- @Column(length=50)
- private String nome;
- public Long getId() {
- return id;
- }
- public void setId(Long id) {
- this.id = id;
- }
- public String getNome() {
- return nome;
- }
- public void setNome(String nome) {
- this.nome = nome;
- }
- @OneToMany (mappedBy="depto")
- private List<Funcionario> funcionarios;
- public List<Funcionario> getFuncionarios() {
- return funcionarios;
- }
- public void setFuncionarios(List<Funcionario> funcionarios) {
- this.funcionarios = funcionarios;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement