Skip to content

My super simplified implementation of Hibernate to get an understanding how Hibernate "magic" works

Notifications You must be signed in to change notification settings

martaisty/kibernate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Kibernate

Test DB setup

Spin up Postgres:

podman run --name kibernate -e POSTGRES_PASSWORD=postgress -p 5432:5432 -d postgres

Test data:

create table users
(
    id   bigserial primary key not null,
    name text,
    age  integer
);

insert into users (name, age)
values ('Joe', 15),
       ('Alice', 21),
       ('Bob', 25),
       ('Mark', 18);

create table skills
(
    id      bigserial primary key not null,
    name    text,
    user_id bigint references users (id)
);

insert into skills(name, user_id)
values ('Guitar', (select u.id from users u where u.name = 'Joe')),
       ('Dancing', (select u.id from users u where u.name = 'Joe')),
       ('Singing', (select u.id from users u where u.name = 'Alice')),
       ('Powerlifting', (select u.id from users u where u.name = 'Alice')),
       ('Swimming', (select u.id from users u where u.name = 'Bob'));

About

My super simplified implementation of Hibernate to get an understanding how Hibernate "magic" works

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages