Skip to content

class table inheritance complete#1977

Closed
KingOfXi wants to merge 31 commits intoiluwatar:masterfrom
KingOfXi:master
Closed

class table inheritance complete#1977
KingOfXi wants to merge 31 commits intoiluwatar:masterfrom
KingOfXi:master

Conversation

@KingOfXi
Copy link

@KingOfXi KingOfXi commented Apr 4, 2022

class table inheritance

Pull request description

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

For detailed contributing instructions see https://github.com/iluwatar/java-design-patterns/wiki/01.-How-to-contribute

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Owner

@iluwatar iluwatar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see the review comments. Additionally, the conflicts need to be resolved.

@@ -0,0 +1,145 @@
---
layout: pattern
title: class table inheritance pattern
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
title: class table inheritance pattern
title: Class Table Inheritance

categories: Creational
language: en
tags:
- Decoupling
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Decoupling
- Data access


**Programmatic Example**

Let's first introduce the `palyer` interface . It defines various methods.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the version from parent pom.xml where possible

Comment on lines +33 to +36
SqlSession sqlSession;
MapperPlayer playerMapper;
sqlSession = Mybatis3Utils.getCurrentSqlSession();
playerMapper = sqlSession.getMapper(MapperPlayer.class);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be reduced to 2 lines. Use var where possible.

Comment on lines +38 to +41
final Player player = new Player();
player.setName("player1");
playerMapper.insertPlayer(player);
sqlSession.commit();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comments explaining what is happening

Comment on lines +234 to +235


Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the.module to the parent pom.xml here

@stale
Copy link

stale bot commented Oct 30, 2022

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.

@stale stale bot added the status: stale issues and pull requests that have not had recent interaction label Oct 30, 2022
@iluwatar iluwatar added this to the 1.26.0 milestone Nov 8, 2022
@iluwatar
Copy link
Owner

iluwatar commented Nov 8, 2022

Closed due to inactivity

@iluwatar iluwatar closed this Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: stale issues and pull requests that have not had recent interaction status: under review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants