minor fixes
This commit is contained in:
parent
1af21ded31
commit
2c141fd89b
|
@ -352,7 +352,7 @@ public class Main {
|
||||||
Here we've used Hibernate's native APIs.
|
Here we've used Hibernate's native APIs.
|
||||||
We could have used JPA-standard APIs to achieve the same thing.
|
We could have used JPA-standard APIs to achieve the same thing.
|
||||||
|
|
||||||
[hello-jpa]
|
[[hello-jpa]]
|
||||||
=== Hello, JPA
|
=== Hello, JPA
|
||||||
|
|
||||||
If we limit ourselves to the use of JPA-standard APIs, we need to use XML to configure Hibernate.
|
If we limit ourselves to the use of JPA-standard APIs, we need to use XML to configure Hibernate.
|
||||||
|
@ -405,6 +405,7 @@ We can put that logic in our own `inSession()` function, so that we don't have t
|
||||||
Again, you don't need to understand any of this code right now.
|
Again, you don't need to understand any of this code right now.
|
||||||
|
|
||||||
[source,java]
|
[source,java]
|
||||||
|
.`Main.java` (JPA version)
|
||||||
----
|
----
|
||||||
package org.hibernate.example;
|
package org.hibernate.example;
|
||||||
|
|
||||||
|
@ -419,7 +420,7 @@ import static java.lang.System.out;
|
||||||
import static org.hibernate.cfg.AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION;
|
import static org.hibernate.cfg.AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION;
|
||||||
import static org.hibernate.tool.schema.Action.CREATE;
|
import static org.hibernate.tool.schema.Action.CREATE;
|
||||||
|
|
||||||
public class JpaMain {
|
public class Main {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
var factory = createEntityManagerFactory("example",
|
var factory = createEntityManagerFactory("example",
|
||||||
// export the inferred database schema
|
// export the inferred database schema
|
||||||
|
|
Loading…
Reference in New Issue