Search code examples
intellij-ideadao

How to generate DAO classes in IntelliJ IDEA


Is it possible to generate DAO classes in IntelliJ IDEA? I found many articles about generating entities but none on generating DAO.

I am using version 11.1.2.


Solution

  • IntelliJ IDEA doesn't support it, you can consider using Hibernate Tools instead via Ant:

    Ant task: The Hibernate3 tools include a unified Ant task that allows you to run schema generation, mapping generation, or Java code generation as part of your build.


    The tools for Hibernate provides various tools to use with Hibernate. The primary tools can be used for generating source artifacts such as mapping files, java entities, DAO and other scaffolding code. The source of this generation can be JDBC database, classes or even just existing mappings.

    It uses Hibernate core metamodel to generate from and to the source artifacts. Allowing it to support both top-down, bottom-up and middle-out development.

    Hibernate Tools is used in JBoss Tools Hibernate plugins to provide parts of the Eclipse plugins for Hibernate.