Ruang penulis
SEBUAH JURNAL TENTANG TEKNOLOGI

Belajar hal baru.
Tulis. Bagikan.

Ruang untuk merangkai pengetahuan, satu baris kode setiap hari.
Temukan tutorial, ide, dan catatan dari perjalanan belajar.

1914 catatan & terus bertumbuh
PILIHAN EDITOR
Java

Memahami Java Stream: olah koleksi dengan lebih ringkas

Pelajari alur filter, map, dan collect untuk mengolah data Java dengan kode yang mudah dibaca.

D Tim Diary Coding · 1 menit baca
UNTUK RASA INGIN TAHUMU

Catatan terbaru.

HIBERNATE / CATATAN</>
Hibernate17 Okt 2008

How do I order the Criteria query result set?

In this demo you’ll see how to order the result set of out Criteria query. It can be done by adding the org.hibernate.criterion.Order into the Criteria object, and we can either order the result in ascending or descending order. package org.kodejava.hibernate; import org.hibernate.SessionFactory; import org.hibernate.Session; import org.hibernate.HibernateException; import org.hibernate.Criteria; import org.hibernate.cfg.Configuration; import org.hibernate.criterion.Order; im...

Wayan · 2 menit baca
HIBERNATE / CATATAN</>
Hibernate15 Okt 2008

How do I add Restrictions to the Criteria object?

In this example you’ll learn how to add restrictions to the Criteria object. Using restriction we can narrow the result of our query. In the code below we add some restrictions such as Restrictions.eq(), Restrictions.like() and Restrictions.isNotNull(). In Hibernate framework you’ll find a lot of class the use a method chaining. As in the example […]

Wayan · 3 menit baca
HIBERNATE / CATATAN</>
Hibernate12 Okt 2008

How do I create a pagination using Criteria?

To create a pagination or limit the result set returned by the Criteria query we can use the setFirstResult() and setMaxResults() method. The setFirstResult() method defines the first row to start with and the setMaxResults() method defines the maximum number of records to read. Let’s see the demo below. package org.kodejava.hibernate; import org.hibernate.SessionFactory; import org.hibernate.Session; […]

Wayan · 2 menit baca
HIBERNATE / CATATAN</>
Hibernate07 Okt 2008

How do I create a Criteria object?

This example show you how to create an instance of Hibernate Criteria class. To create a Criteria we call the factory method of the Session object and pass the persistence class as parameter. To execute the Criteria query we simply call the list() method. package org.kodejava.hibernate; import org.hibernate.SessionFactory; import org.hibernate.Session; import org.hibernate.HibernateException; import org.hibernate.Criteria; import […]

Wayan · 2 menit baca
SWING / CATATAN</>
Swing05 Okt 2008

How do I create a message dialog box?

This example demonstrate how to create a message dialog box using the JOptionPane class methods. In the code below you’ll see the use of JOptionPane.showMessageDialog(), JOptionPane.showInputDialog() and JOptionPane.showConfirmDialog(). package org.kodejava.swing; import javax.swing.*; import java.awt.*; public class MessageDialogDemo extends JFrame { public MessageDialogDemo() throws HeadlessException { initialize(); } public static void main(String[] args) { SwingUtilities....

Wayan · 2 menit baca
CORE API / CATATAN</>
Core API03 Okt 2008

How do I execute external command and obtain the result?

This example demonstrate how to execute an external command from Java and obtain the result of the command. Here we simply execute a Linux ls -al command on the current working directory and display the result. package org.kodejava.lang; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; public class ProcessResult { public static void main(String[] args) { try […]

Wayan · 2 menit baca

Pengetahuan tumbuh ketika dibagikan.

Simpan rasa ingin tahu. Selalu ada hal baru untuk dipelajari.

Jelajahi catatan ↗
Putu Adi Guna Permana
TENTANG PENULIS

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Penulis dan pendiri Diary Coding — berbagi catatan, tutorial, dan pengalaman seputar pemrograman untuk siapa pun yang ingin terus belajar.