11.07.2015 Views

Persistência com JPA2 e Hibernate - Inpi

Persistência com JPA2 e Hibernate - Inpi

Persistência com JPA2 e Hibernate - Inpi

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

159 MAPEAMENTO COM XMLFigura D.8: Personalizando a tabela de relacionamentoExercícios de Fixação12 Implemente duas entidades no pacote br.<strong>com</strong>.k19.modelo do projeto K19-Mapeamento-XML:Departamento e Funcionario.1 public class Funcionario {2 private Long id;3 private String nome ;45 // GETTERS AND SETTERS6 }Código Java D.22: Funcionario.java1 public class Departamento {2 private Long id;3 private String nome ;4 private Collection < Funcionario > funcionarios = new ArrayList < Funcionario >() ;56 // GETTERS AND SETTERS7 }Código Java D.23: Departamento.java13 Edite o arquivo orm.xml da pasta src/META-INF do projeto K19-Mapeamento-XML de acordo.1 . . .2 3 4 5 6 7 8 910 11 12 13 14 1516 17 18 www.k19.<strong>com</strong>.br 159

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!