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
base: master
Are you sure you want to change the base?
Conversation
<dependency> | ||
<groupId>org.hibernate.orm</groupId> | ||
<artifactId>hibernate-core</artifactId> | ||
<version>6.3.0.Final</version> | ||
</dependency> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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
<maven.compiler.source>17</maven.compiler.source> | ||
<maven.compiler.target>17</maven.compiler.target> |
There was a problem hiding this comment.
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
<maven.compiler.source>17</maven.compiler.source> | |
<maven.compiler.target>17</maven.compiler.target> |
public Student() { | ||
} |
There was a problem hiding this comment.
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
public Student() { | |
} | |
public Student() { | |
// required for Hibernate | |
} |
<!--<selectKey keyProperty = "id" resultType = "int" order = "AFTER"> | ||
SELECT CURRENT VALUE FOR dbMyBatis.STUDENT_TBL_SEQ | ||
</selectKey>--> |
There was a problem hiding this comment.
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?
Student zeeshFetched; | ||
Student bilalFetched; |
There was a problem hiding this comment.
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
} catch (Exception e) { | ||
StandardServiceRegistryBuilder.destroy(registry); | ||
} |
There was a problem hiding this comment.
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:
} catch (Exception e) { | |
StandardServiceRegistryBuilder.destroy(registry); | |
} | |
} catch (Exception e) { | |
StandardServiceRegistryBuilder.destroy(registry); | |
throw e; | |
} |
} | ||
|
||
@Test | ||
public void hibernateExample() { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
No description provided.