Creating a Hibernate Reverse Engineering File
Consulte também
To use the Hibernate Mapping Files and POJOs from a Database wizard, you need to first create a Hibernate reverse engineering file (hibernate.reveng.xml). The IDE provides a wizard for generating the file based on the data contained in the Hibernate configuration file and the tables you are using in your application.
The reverse engineering file is an XML file that can be used to modify the default settings used when generating Hibernate files from the metadata of the database specified in hibernate.cfg.xml. The file can be used to explicitly specify the database schema that is used, to filter out tables that should not be used and how JDBC types are mapped to Hibernate types.
To create hibernate.reveng.xml using the New File wizard:
- Abra o assistente para Novo arquivo.
- Select Hibernate from the Categories list and Hibernate Reverse Engineering Wizard from the File Types list. Clique em Próximo.
- Type hibernate.reveng for the name and specify the Folder where you want to save the file. Clique em Próximo.
- Select the Configuration File from the drop down list.
- O arquivo de configuração contém os detalhes da conexão do banco de dados. Se uma conexão ao banco de dados não estiver aberta, você pode ser solicitado a fornecer um nome de usuário e senha para conectar ao banco de dados. O banco de dados deve estar em execução.
- Selecione quaisquer tabelas no painel Tabelas disponíveis e clique em Adicionar para mover as tabelas para o painel Tabelas selecionadas. Quaisquer tabelas relacionada a tabelas que você selecionar são adicionadas automaticamente à lista no painel Tabelas selecionadas.
- Clique em Finalizar.
When you click Finish, the file hibernate.reveng.xml is created in the location you specified and the file opens in the Source Editor.
- Consulte também
- Sobre o suporte a Hibernate
- Editando o arquivo de configuração do Hibernate
- Criando os arquivos de mapeamento do Hibernate
- Adicionando suporte Hibernate a projeto
Notificações legais