Home > Back-end >  Spring JPA can fully automated to generate mapper interfaces, entity classes, XML??
Spring JPA can fully automated to generate mapper interfaces, entity classes, XML??

Time:09-24

Mybatis can configure maven plugin to automatically generate the entity + dao + + maper mapper interfaces. The XML.

1. That JPA can do it?

2. Does not mean that the JPA is a fully automated, specific refers to that aspect?


Consult everybody bosses guidance!!!!!!

CodePudding user response:

1. Whether the idea or the eclipse can generate entity class, through the table structure of reverse eclipse operating tutorial, the idea of operating tutorial


2. You said the Spring Data JPA fully automated may refers to the entity class Repository interface (similar to the Mapper interfaces) inheriting JpaRepository, by defining the find/get the attribute name and attribute name 1 2 () method, which don't have to write their own specific SQL, framework to automatically generate properties 1 and 2 to the corresponding database field called conditions of SQL query. For example, a Student class, have a username, class attributes, such as through defined in StudentRepository findUsernameAndClass (String username, String class); Framework will automatically generate a similar select id, username, class from student where username=? And class=? SQL. The Spring Data JPA can also through the Specification or Example to build the Query conditions, can also be achieved by @ HQL Query annotation or custom SQL queries.

CodePudding user response:

Yes, open idea and View - & gt; Tool Windows - & gt; database
  • Related