- person Penulis:
-
Dimas Maryanto
PT. Tabeldata Informatika
- account_balance_wallet Donasi via:
- Saweria a/n Dimas Maryanto
- lock_open Join Premium Members:
- Udemy.com
-
Daftar Materi
-
1. Pengenalan ORM Hibernate 13
-
1. Silabus Belajar JPA Hibernate
2. Pengenalan ORM dengan Hibernate Framework
3. Setup Development Environment
4. Membuat project Hibernate ORM dengan Apache Maven
5. Build Hibernate Session Factory
6. Memahami fungsi hibernate.cfg.xml
7. Membuat Simple Entity di Hibernate
8. Basic Annotation pada Hibernate
9. CRUD menggunakan Hibernate
10. Macam-Macam Constraint di Hibernate
11. Macam Macam Generator Value di Hibernate
12. Composite Primary Key
13. Time is your practice
-
2. ORM Mappings 19
-
1. Hibernate ORM Relationship Mapping
2. Mapping Enum Ordinal & String
3. Embbeded Mapping
4. Embbeded Mapping dengan Override Attributes
5. OneToOne Mapping
6. OneToMany Mapping
7. ManyToOne Mapping
8. ManyToMany Mapping
9. Macam-Macam Inherintance Mapping
10. Inherintance Mapping metode MappedSuperclass
11. Inherintance Mapping methode Single Table
12. Inherintance Mapping metode Single Table menggunakan Descriminator column dan value
13. Inherintance Mapping metode Join Table
14. Inherintance Mapping metode Table Per Class
15. Parent-Child Mapping
16. Collections Mapping
17. Collections Mapping as a Value
18. Collections Mapping as a Value Types
19. Time is your Practice
-
3. Hibernete Query Language (HQL) 25
-
1. Hibernate Query Language (HQL-JPQL)
2. Select Statement dengan HQL
3. Insert, Update dan Delete Statement dengan HQL
4. Join Entity dengan Hibernate Query Language (HQL)
5. Distinct dengan HQL
6. Aritmatic dengan HQL
7. Concatnation dengan HQL
8. Aggregation Function dengan HQL
9. Case When dengan HQL
10. Coalesce & NullIF menggunakan HQL
11. Predicates / Conditional Expressions dengan HQL
12. Relational Comparison Predicate dengan HQL
13. Nullness Predicate dengan HQL
14. Predicate LIKE dengan HQL
15. Predicate BETWEEN dengan HQL
16. Predicate IN dengan HQL
17. Empty Collections Predicate dengan HQL
18. SubQuery Qualifiers dengan HQL
19. Not Predicate dengan HQL
20. Combine Predicate dengan HQL
21. Group By dengan HQL
22. Order By dengan HQL
23. LIMIT & OFFSET dengan HQL
24. Read Only Entity dengan HQL
25. Time is your Practice
-
4. Hibernete Criteria API
- Materi: belum tersedia...
-
5. Java Persistence Query Language (JPQL)
- Materi: belum tersedia...
-
6. Audit with Hibernete Envers
- Materi: belum tersedia...
-
7. Caching
- Materi: belum tersedia...
- Lastest Posts
- 09 Apr 23 Working with Deployment object
- 26 Feb 23 Study cases: Microservice apps (...
- 05 Feb 23 Welcome to the Nutanix HCF (Hybr...
- 04 Feb 23 Silabus SRE - Nutanix AHV: Pemul...
- 17 Jan 23 What is Workload Resources?
- 17 Jan 23 Overview Kubernetes Workloads re...
- 15 Jan 23 Getting started with Transaction...
- 14 Jan 23 Overview of Concurrency Control
- 14 Jan 23 Time your practice (part 3)
- 08 Jan 23 Cleanup Data from Table
Inherintance Mapping metode MappedSuperclass
Hai, di materi kali ini saya mau ngebahas tentang Inherintance Mapping dengan Metode MappedSuperclass. Untuk mencoba mapping ini, kita membutuhkan 2 tabel yang memiliki column yang hampir sama contohnya mobil
sama motor
berikut adalah perancangan databasenya:
Implementasi Entity superclass:
Implementasi Entity child mobil
:
Implementasi Entity child motor
:
Implementasi DAO untuk mobil
:
Implementasi DAO untuk motor
:
Kemudian kita buat unit testingnya seperti berikut:
Jika di running maka hasilnya seperti berikut:
INFO: HHH10001501: Connection obtained from JdbcConnectionAccess [org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess@1e1e837d] 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 inherintance.mobil_mappedsuperclass (
id varchar(64) not null,
cc int4,
jumlah_cylinder int4,
jumlah_roda int4,
nama varchar(50),
nama_pabrikan varchar(50) not null,
is_all_wheel_drive boolean not null,
jumlah_kursi int4,
primary key (id)
)
Hibernate:
create table inherintance.motor_mappedsuperclass (
id varchar(64) not null,
cc int4,
jumlah_cylinder int4,
jumlah_roda int4,
nama varchar(50),
nama_pabrikan varchar(50) not null,
jenis_rantai varchar(255),
primary key (id)
)
Jan 16, 2021 12:00:08 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
inherintance.mobil_mappedsuperclass
(cc, jumlah_cylinder, jumlah_roda, nama, nama_pabrikan, is_all_wheel_drive, jumlah_kursi, id)
values
(?, ?, ?, ?, ?, ?, ?, ?)
[main] INFO com.maryanto.dimas.bootcamp.test.mapping.inherintance.TestMappedSuperClass - mobil: MobilMappedSuperclass(super=KendaraanMappedSuperclass(nama=Honda BRIO, jumlahRoda=4, jumlahCylinder=4, cc=1000, namaPabrikan=PT. Honda Motor Company), id=c5a7398c-a79c-4abd-9c55-deb3ec1e2bad, jumlahKursi=4, allWheelDrive=false)
[main] INFO com.maryanto.dimas.bootcamp.test.mapping.inherintance.TestMappedSuperClass - destroy hibernate session!
Yuk simak juga videonya,
Dan jika temen-temen belajar hal baru kali ini jangan lupa buat Like, Subcribe, dan Share ke temen kalian. Terimakasih!!!