class table inheritance complete#1977
Conversation
|
Kudos, SonarCloud Quality Gate passed!
|
iluwatar
left a comment
There was a problem hiding this comment.
Please see the review comments. Additionally, the conflicts need to be resolved.
| @@ -0,0 +1,145 @@ | |||
| --- | |||
| layout: pattern | |||
| title: class table inheritance pattern | |||
There was a problem hiding this comment.
| title: class table inheritance pattern | |
| title: Class Table Inheritance |
| categories: Creational | ||
| language: en | ||
| tags: | ||
| - Decoupling |
There was a problem hiding this comment.
| - Decoupling | |
| - Data access |
|
|
||
| **Programmatic Example** | ||
|
|
||
| Let's first introduce the `palyer` interface . It defines various methods. |
There was a problem hiding this comment.
| Let's first introduce the `palyer` interface . It defines various methods. | |
| Let's first introduce the `Player` interface . It defines various methods. | |
| <dependency> | ||
| <groupId>org.projectlombok</groupId> | ||
| <artifactId>lombok-maven-plugin</artifactId> | ||
| <version>1.18.12.0</version> |
There was a problem hiding this comment.
Use the version from parent pom.xml where possible
| SqlSession sqlSession; | ||
| MapperPlayer playerMapper; | ||
| sqlSession = Mybatis3Utils.getCurrentSqlSession(); | ||
| playerMapper = sqlSession.getMapper(MapperPlayer.class); |
There was a problem hiding this comment.
This can be reduced to 2 lines. Use var where possible.
| final Player player = new Player(); | ||
| player.setName("player1"); | ||
| playerMapper.insertPlayer(player); | ||
| sqlSession.commit(); |
There was a problem hiding this comment.
Add comments explaining what is happening
|
|
||
|
|
There was a problem hiding this comment.
Add the.module to the parent pom.xml here
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
Closed due to inactivity |








class table inheritance
Pull request description
implement it according to https://www.sourcecodeexamples.net/2018/05/class-table-inheritance-pattern.html