Skip to content

Instantly share code, notes, and snippets.

@kennedyw
Created March 23, 2023 17:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kennedyw/e0fd7bddfb14a5ea82431aa800dda723 to your computer and use it in GitHub Desktop.
Save kennedyw/e0fd7bddfb14a5ea82431aa800dda723 to your computer and use it in GitHub Desktop.
Mar 21, 2023 3:21:52 PM org.hibernate.jpa.internal.util.LogHelper logPersistenceUnitInformation
INFO: HHH000204: Processing PersistenceUnitInfo [name: wyatt-test]
Mar 21, 2023 3:21:52 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate ORM core version 6.1.7.Final
Mar 21, 2023 3:21:52 PM org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl lambda$normalizeConnectionAccessUserAndPass$2
WARN: HHH90000021: Encountered deprecated setting [javax.persistence.jdbc.user], use [jakarta.persistence.jdbc.user] instead
Mar 21, 2023 3:21:52 PM org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl lambda$normalizeConnectionAccessUserAndPass$8
WARN: HHH90000021: Encountered deprecated setting [javax.persistence.jdbc.password], use [jakarta.persistence.jdbc.password] instead
Mar 21, 2023 3:21:52 PM org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl normalizeDataAccess
WARN: HHH90000021: Encountered deprecated setting [javax.persistence.jdbc.url], use [jakarta.persistence.jdbc.url] instead
Mar 21, 2023 3:21:52 PM org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl lambda$normalizeDataAccess$20
WARN: HHH90000021: Encountered deprecated setting [javax.persistence.jdbc.driver], use [jakarta.persistence.jdbc.driver] instead
Mar 21, 2023 3:21:52 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
WARN: HHH10001002: Using built-in connection pool (not intended for production use)
Mar 21, 2023 3:21:52 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH10001005: Loaded JDBC driver class: org.postgresql.Driver
Mar 21, 2023 3:21:52 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH10001012: Connecting with JDBC URL [jdbc:postgresql://localhost:5432/postgres]
Mar 21, 2023 3:21:52 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH10001001: Connection properties: {password=****, user=postgres}
Mar 21, 2023 3:21:52 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH10001003: Autocommit mode: false
Mar 21, 2023 3:21:52 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl$PooledConnections <init>
INFO: HHH10001115: Connection pool size: 20 (min=1)
Mar 21, 2023 3:21:53 PM org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl logSelectedDialect
INFO: HHH000400: Using dialect: org.hibernate.dialect.PostgreSQLDialect
Mar 21, 2023 3:21:54 PM org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator$ActionGrouping determineJpaDbActionSetting
WARN: HHH90000021: Encountered deprecated setting [javax.persistence.schema-generation.database.action], use [jakarta.persistence.schema-generation.database.action] instead
Hibernate: alter table if exists EXTENDED_REFERENCE drop constraint if exists FKtd5kgi3916neyveayv88e5n48
Hibernate: alter table if exists TEST drop constraint if exists FK75fyfx5el7tpkf6fo8wyesw2d
Hibernate: alter table if exists TEST_LAZY drop constraint if exists FKmdj433d018pydbyhavmhk59cn
Hibernate: alter table if exists TEST_NON_POLY_EAGER drop constraint if exists FK71b68jlfxdbtg319mtquj2k4g
Hibernate: alter table if exists TEST_NON_POLY_LAZY drop constraint if exists FK44aqeeab8h7ii75mc93t7pq3r
Hibernate: drop table if exists EXTENDED_REFERENCE cascade
Mar 21, 2023 3:21:54 PM org.hibernate.resource.transaction.backend.jdbc.internal.DdlTransactionIsolatorNonJtaImpl getIsolatedConnection
INFO: HHH10001501: Connection obtained from JdbcConnectionAccess [org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess@32b0876c] for (non-JTA) DDL execution was not in auto-commit mode; the Connection 'local transaction' will be committed and the Connection will be set into auto-commit mode.
Hibernate: drop table if exists NON_POLY_REFERENCE cascade
Hibernate: drop table if exists REFERENCE cascade
Hibernate: drop table if exists TEST cascade
Hibernate: drop table if exists TEST_LAZY cascade
Hibernate: drop table if exists TEST_NON_POLY_EAGER cascade
Hibernate: drop table if exists TEST_NON_POLY_LAZY cascade
Hibernate: create table EXTENDED_REFERENCE (NUM bigint, ID bigint not null, primary key (ID))
Hibernate: create table NON_POLY_REFERENCE (ID bigserial not null, NAME varchar(255), primary key (ID))
Hibernate: create table REFERENCE (ID bigserial not null, NAME varchar(255), primary key (ID))
Hibernate: create table TEST (ID bigserial not null, REFERENCE_ID bigint not null, primary key (ID))
Mar 21, 2023 3:21:54 PM org.hibernate.resource.transaction.backend.jdbc.internal.DdlTransactionIsolatorNonJtaImpl getIsolatedConnection
INFO: HHH10001501: Connection obtained from JdbcConnectionAccess [org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess@65ddee5a] for (non-JTA) DDL execution was not in auto-commit mode; the Connection 'local transaction' will be committed and the Connection will be set into auto-commit mode.
Hibernate: create table TEST_LAZY (ID bigserial not null, REFERENCE_ID bigint not null, primary key (ID))
Hibernate: create table TEST_NON_POLY_EAGER (ID bigserial not null, REFERENCE_ID bigint not null, primary key (ID))
Hibernate: create table TEST_NON_POLY_LAZY (ID bigserial not null, REFERENCE_ID bigint not null, primary key (ID))
Hibernate: alter table if exists EXTENDED_REFERENCE add constraint FKtd5kgi3916neyveayv88e5n48 foreign key (ID) references REFERENCE
Hibernate: alter table if exists TEST add constraint FK75fyfx5el7tpkf6fo8wyesw2d foreign key (REFERENCE_ID) references REFERENCE
Hibernate: alter table if exists TEST_LAZY add constraint FKmdj433d018pydbyhavmhk59cn foreign key (REFERENCE_ID) references REFERENCE
Hibernate: alter table if exists TEST_NON_POLY_EAGER add constraint FK71b68jlfxdbtg319mtquj2k4g foreign key (REFERENCE_ID) references NON_POLY_REFERENCE
Hibernate: alter table if exists TEST_NON_POLY_LAZY add constraint FK44aqeeab8h7ii75mc93t7pq3r foreign key (REFERENCE_ID) references NON_POLY_REFERENCE
Mar 21, 2023 3:21:54 PM org.hibernate.engine.transaction.jta.platform.internal.JtaPlatformInitiator initiateService
INFO: HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
Hibernate: insert into REFERENCE (NAME) values (?)
Hibernate: insert into EXTENDED_REFERENCE (NUM, ID) values (?, ?)
Hibernate: insert into TEST (REFERENCE_ID) values (?)
Hibernate: insert into TEST_LAZY (REFERENCE_ID) values (?)
Hibernate: insert into NON_POLY_REFERENCE (NAME) values (?)
Hibernate: insert into TEST_NON_POLY_EAGER (REFERENCE_ID) values (?)
Hibernate: insert into TEST_NON_POLY_LAZY (REFERENCE_ID) values (?)
TEST 1 - fetch entity with eager many to one non polymorphic reference
find entity
Hibernate: select t1_0.ID,r1_0.ID,r1_0.NAME from TEST_NON_POLY_EAGER t1_0 join NON_POLY_REFERENCE r1_0 on r1_0.ID=t1_0.REFERENCE_ID where t1_0.ID=?
getting reference - usually no sql
Reference is a proxy - false
getting name value from ref object - will spawn sql for lazy
asdf
TEST 1 - completed
TEST 2 - fetch entity with lazy many to one non polymorphic reference
find entity
Hibernate: select t1_0.ID,t1_0.REFERENCE_ID from TEST_NON_POLY_LAZY t1_0 where t1_0.ID=?
getting reference - usually no sql
Reference is a proxy - true
getting name value from ref object - will spawn sql for lazy
Hibernate: select n1_0.ID,n1_0.NAME from NON_POLY_REFERENCE n1_0 where n1_0.ID=?
asdf
TEST 2 - completed
TEST 3 - fetch entity with eager many to one with polymorphic reference
find entity
Hibernate: select t1_0.ID,r1_0.ID,case when r1_1.ID is not null then 1 when r1_0.ID is not null then 0 end,r1_0.NAME,r1_1.NUM from TEST t1_0 join (REFERENCE r1_0 left join EXTENDED_REFERENCE r1_1 on r1_0.ID=r1_1.ID) on r1_0.ID=t1_0.REFERENCE_ID where t1_0.ID=?
getting reference - usually no sql
Reference is a proxy - false
getting name value from ref object - will spawn sql for lazy
asdf
TEST 3 - completed
TEST 4 - fetch entity with lazy many to one with polymorphic reference
find entity
Hibernate: select t1_0.ID,t1_0.REFERENCE_ID from TEST_LAZY t1_0 where t1_0.ID=?
getting reference - usually no sql
Reference is a proxy - true
getting name value from ref object - will spawn sql for lazy
Hibernate: select r1_0.ID,case when r1_1.ID is not null then 1 when r1_0.ID is not null then 0 end,r1_0.NAME,r1_1.NUM from REFERENCE r1_0 left join EXTENDED_REFERENCE r1_1 on r1_0.ID=r1_1.ID where r1_0.ID=?
asdf
TEST 4 - completed
TEST 5 - showcase of behavior fetching entity with lazy ref first in session
fetch object with lazy ref that creates ref as proxy
Hibernate: select t1_0.ID,t1_0.REFERENCE_ID from TEST_LAZY t1_0 where t1_0.ID=?
ref of initial lazy fetch is proxy - true
now fetch object with eager ref that reference the same ref fetched previously
Hibernate: select t1_0.ID,r1_0.ID,case when r1_1.ID is not null then 1 when r1_0.ID is not null then 0 end,r1_0.NAME,r1_1.NUM from TEST t1_0 join (REFERENCE r1_0 left join EXTENDED_REFERENCE r1_1 on r1_0.ID=r1_1.ID) on r1_0.ID=t1_0.REFERENCE_ID where t1_0.ID=?
ref of subsequent eager fetch after first fetch is a proxy - true
the generated proxy is not of the correct concrete type - true
SQL should occur here when I attempt to unproxy
after unproxying the object, it is of the correct concrete type - true
TEST 5 - completed
Process finished with exit code 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment