- 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
Group By dengan HQL
Hai di kesempatan kali ini saya mau membahas tentang Group By
dan clausa Having
dengan menggunakan Hibernate Query Language (HQL).
Sekarang kita buat modelnya dulu seperti berikut:
Dan berikut adalah implementasi DAO:
Implementasi Unit Testing:
Berikut adalah contoh data yang saya gunakan:
Setelah itu coba jalankan unit testing pada method testGroupBy()
, hasilnya seperti berikut:
Feb 02, 2021 4:03:35 PM org.hibernate.engine.transaction.jta.platform.internal.JtaPlatformInitiator initiateService
INFO: HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
Hibernate:
select
employeepa0_.job_id as col_0_0_,
sum(employeepa0_.salary) as col_1_0_
from
parentchild.employees employeepa0_
group by
employeepa0_.job_id
[main] INFO com.maryanto.dimas.bootcamp.test.query.hql.TestHQLGroupByDao - data: [GroupByModel(jobName=Bisnis Analys, salary=6900000.00), GroupByModel(jobName=Chief Technology Officer, salary=10000000.00), GroupByModel(jobName=Software Engineer, salary=13000000.00), GroupByModel(jobName=Principal Software Engineer, salary=3500000.00)]
[main] INFO com.maryanto.dimas.bootcamp.test.query.hql.TestHQLGroupByDao - destroy hibernate session!
dan yang terakhir coba jalankan method testGroupByWithHaving()
, maka hasilnya berikut:
Feb 02, 2021 4:04:33 PM org.hibernate.engine.transaction.jta.platform.internal.JtaPlatformInitiator initiateService
INFO: HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
Hibernate:
select
employeepa0_.job_id as col_0_0_,
sum(employeepa0_.salary) as col_1_0_
from
parentchild.employees employeepa0_
group by
employeepa0_.job_id
having
sum(employeepa0_.salary)>=?
[main] INFO com.maryanto.dimas.bootcamp.test.query.hql.TestHQLGroupByDao - data: [GroupByModel(jobName=Bisnis Analys, salary=6900000.00), GroupByModel(jobName=Chief Technology Officer, salary=10000000.00), GroupByModel(jobName=Software Engineer, salary=13000000.00)]
[main] INFO com.maryanto.dimas.bootcamp.test.query.hql.TestHQLGroupByDao - 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!!!