- 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 Single Table menggunakan Descriminator column dan value
Hai pada materi kali ini saya mau mengebahas tentang annotation @Discriminator, dengan annotation tersebut kita bisa menubah property/column dtype
yang hibernate buat. contohnya disini saya mau ganti menjadi jenis_kendaraan
dengan pilihan class MobilSingleTable = Mobil
dan MotorSingleTable = Motor
.
berikut Implementasi Entity Kendaraan:
Impementasi Entity Mobil:
Implementasi Entity Motor:
Implementasi DAO Kendaraan:
Implementasi Unit Testing Kendaraan:
Jika unit testing di running maka hasilnya seperti berikut:
INFO: HHH10001501: Connection obtained from JdbcConnectionAccess [org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess@595f9916] 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.kendaraan_singletable_discriminator (
jenis_kendaraan varchar(31) not null,
id varchar(255) not null,
cc int4,
jumlah_cylinder int4,
jumlah_roda int4,
nama varchar(50),
nama_pabrikan varchar(50) not null,
is_all_wheel_drive boolean,
jumlah_kursi int4,
jenis_rantai varchar(255),
primary key (id)
)
Jan 16, 2021 3:59:53 PM org.hibernate.engine.transaction.jta.platform.internal.JtaPlatformInitiator initiateService
INFO: HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
[main] INFO com.maryanto.dimas.bootcamp.test.mapping.inherintance.TestKendaraanSingleTableDiscriminator - connected!
Hibernate:
insert
into
inherintance.kendaraan_singletable_discriminator
(cc, jumlah_cylinder, jumlah_roda, nama, nama_pabrikan, is_all_wheel_drive, jumlah_kursi, jenis_kendaraan, id)
values
(?, ?, ?, ?, ?, ?, ?, 'Mobil', ?)
[main] INFO com.maryanto.dimas.bootcamp.test.mapping.inherintance.TestKendaraanSingleTableDiscriminator - mobil: MobilSingleTableDiscriminatorEntity(super=KendaraanSingleTableDiscriminatorEntity(id=c5896473-7455-4e0d-8863-d386366e43d1, nama=Honda BRIO, jumlahRoda=4, jumlahCylinder=4, cc=1000, namaPabrikan=PT. Honda Motor Company), jumlahKursi=4, allWheelDrive=false)
[main] INFO com.maryanto.dimas.bootcamp.test.mapping.inherintance.TestKendaraanSingleTableDiscriminator - destroy hibernate session!
Nah coba kita check tabelnya, maka hasilnya sebagai berikut:
Yuk simak juga videonya,
Dan jika temen-temen belajar hal baru kali ini jangan lupa buat Like, Subcribe, dan Share ke temen kalian. Terimakasih!!!