Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bael 7772 my batis vs hibernate #16637

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

zeesh49
Copy link
Contributor

@zeesh49 zeesh49 commented May 12, 2024

No description provided.

Comment on lines +34 to +38
<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId>
<version>6.3.0.Final</version>
</dependency>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Fix formatting + include a property like ${hibernate.version}

Same for the mybatis dependency

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.10.2</version>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use existing ${junit-jupiter.version} from the parent

<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>2.2.224</version>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use existing ${h2.version} from the parent

Comment on lines +42 to +43
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
Copy link
Collaborator

Choose a reason for hiding this comment

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

These are not required, due to the way the parent modules are set up, specifying java.version is sufficient

Suggested change
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>

Comment on lines +25 to +26
public Student() {
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

If this is required for Hibernate, make it clear with a comment

Suggested change
public Student() {
}
public Student() {
// required for Hibernate
}

Comment on lines +12 to +14
<!--<selectKey keyProperty = "id" resultType = "int" order = "AFTER">
SELECT CURRENT VALUE FOR dbMyBatis.STUDENT_TBL_SEQ
</selectKey>-->
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this commented out?

Comment on lines +37 to +38
Student zeeshFetched;
Student bilalFetched;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Move these declarations closer to their usage

Comment on lines +34 to +36
} catch (Exception e) {
StandardServiceRegistryBuilder.destroy(registry);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

We want the test to fail if there is an exception here, so throw it:

Suggested change
} catch (Exception e) {
StandardServiceRegistryBuilder.destroy(registry);
}
} catch (Exception e) {
StandardServiceRegistryBuilder.destroy(registry);
throw e;
}

}

@Test
public void hibernateExample() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We use BDD style given_when_then or when_then naming for our test methods

}

@Test
public void whenStudentsInsertedThenSearched() throws IOException {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We use BDD style given_when_then or when_then naming for our test methods

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants