// Path: src/main/java/com/storage/mywarehouse/Dao/CustomerDAO.java
// public class CustomerDAO {
//     @SuppressWarnings("unchecked")
//     public static List<Customer> findAll() {
//         Session session = NewHibernateUtil.getSessionFactory().openSession();
//         Transaction tx = session.beginTransaction();
//         List customers = session.createCriteria(Customer.class).list();
//         tx.commit();
//         session.close();
//         return customers;
//     }
// 
//     public static void save(Customer customer) {
//         Session session = NewHibernateUtil.getSessionFactory().openSession();
//         Transaction tx = session.beginTransaction();
//         Customer customerWithHighestId = (Customer) session.createCriteria(Customer.class).addOrder(Order.desc("customerId")).setMaxResults(1).uniqueResult();
//         int nextId;
//         if (customerWithHighestId == null) {
//             nextId = 0;
//         } else {
//             nextId = customerWithHighestId.getCustomerId() + 1;
//         }
//         customer.setCustomerId(nextId);
//         session.save(customer);
//         tx.commit();
//         session.close();
//     }
// 
//     public static void update(Customer customer) {
//         Session session = NewHibernateUtil.getSessionFactory().openSession();
//         Transaction tx = session.beginTransaction();
//         session.update(customer);
//         tx.commit();
//         session.close();
//     }
// 
//     public static void delete(Customer customer) {
//         Session session = NewHibernateUtil.getSessionFactory().openSession();
//         Transaction tx = session.beginTransaction();
//         session.delete(customer);
//         tx.commit();
//         session.close();
//     }
// 
//     public static void deleteAll(List<Customer> customers) {
//         Session session = NewHibernateUtil.getSessionFactory().openSession();
//         Transaction tx = session.beginTransaction();
//         for (Customer c : customers) {
//             session.delete(c);
//         }
//         tx.commit();
//         session.close();
//     }
// }
// 
// Path: src/main/java/com/storage/mywarehouse/Entity/Customer.java
// public class Customer  implements java.io.Serializable {
// 
// 
//      private int customerId;
//      private String name;
//      private String lastName;
//      private String occupation;
//      private double discount;
//      private String email;
//      private String city;
//      private String postal;
//      private String telephone;
// 
// 
//     public Customer() {
//     }
// 
//     public Customer(int customerId, String name, String lastName, String occupation, double discount,
//                     String email, String city, String postal, String telephone) {
//         this.customerId = customerId;
//         this.name = name;
//         this.lastName = lastName;
//         this.occupation = occupation;
//         this.discount = discount;
//         this.email = email;
//         this.city = city;
//         this.postal = postal;
//         this.telephone = telephone;
//     }
// 
//     public int getCustomerId() {
//         return this.customerId;
//     }
//     
//     public void setCustomerId(int customerId) {
//         this.customerId = customerId;
//     }
//     public String getName() {
//         return this.name;
//     }
//     
//     public void setName(String name) {
//         this.name = name;
//     }
//     public String getLastName() {
//         return this.lastName;
//     }
//     
//     public void setLastName(String lastName) {
//         this.lastName = lastName;
//     }
//     public String getOccupation() {
//         return this.occupation;
//     }
//     
//     public void setOccupation(String occupation) {
//         this.occupation = occupation;
//     }
//     public double getDiscount() {
//         return this.discount;
//     }
//     
//     public void setDiscount(double discount) {
//         this.discount = discount;
//     }
// 
//     public String getEmail() {
//         return email;
//     }
// 
//     public void setEmail(String email) {
//         this.email = email;
//     }
// 
//     public String getCity() {
//         return city;
//     }
// 
//     public void setCity(String city) {
//         this.city = city;
//     }
// 
//     public String getPostal() {
//         return postal;
//     }
// 
//     public void setPostal(String postal) {
//         this.postal = postal;
//     }
// 
//     public String getTelephone() {
//         return telephone;
//     }
// 
//     public void setTelephone(String telephone) {
//         this.telephone = telephone;
//     }
// }


import com.storage.mywarehouse.Dao.CustomerDAO;
import com.storage.mywarehouse.Entity.Customer;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Last Name", "First Name", "Occupation", "Discount"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        jScrollPane1.setViewportView(jTable1);

        jButton1.setText("Delete Customer");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setText("Edit Customer");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
// Path: src/main/java/com/storage/mywarehouse/Dao/CustomerDAO.java
// public class CustomerDAO {
//     @SuppressWarnings("unchecked")
//     public static List<Customer> findAll() {
//         Session session = NewHibernateUtil.getSessionFactory().openSession();
//         Transaction tx = session.beginTransaction();
//         List customers = session.createCriteria(Customer.class).list();
//         tx.commit();
//         session.close();
//         return customers;
//     }
// 
//     public static void save(Customer customer) {
//         Session session = NewHibernateUtil.getSessionFactory().openSession();
//         Transaction tx = session.beginTransaction();
//         Customer customerWithHighestId = (Customer) session.createCriteria(Customer.class).addOrder(Order.desc("customerId")).setMaxResults(1).uniqueResult();
//         int nextId;
//         if (customerWithHighestId == null) {
//             nextId = 0;
//         } else {
//             nextId = customerWithHighestId.getCustomerId() + 1;
//         }
//         customer.setCustomerId(nextId);
//         session.save(customer);
//         tx.commit();
//         session.close();
//     }
// 
//     public static void update(Customer customer) {
//         Session session = NewHibernateUtil.getSessionFactory().openSession();
//         Transaction tx = session.beginTransaction();
//         session.update(customer);
//         tx.commit();
//         session.close();
//     }
// 
//     public static void delete(Customer customer) {
//         Session session = NewHibernateUtil.getSessionFactory().openSession();
//         Transaction tx = session.beginTransaction();
//         session.delete(customer);
//         tx.commit();
//         session.close();
//     }
// 
//     public static void deleteAll(List<Customer> customers) {
//         Session session = NewHibernateUtil.getSessionFactory().openSession();
//         Transaction tx = session.beginTransaction();
//         for (Customer c : customers) {
//             session.delete(c);
//         }
//         tx.commit();
//         session.close();
//     }
// }
// 
// Path: src/main/java/com/storage/mywarehouse/Entity/Customer.java
// public class Customer  implements java.io.Serializable {
// 
// 
//      private int customerId;
//      private String name;
//      private String lastName;
//      private String occupation;
//      private double discount;
//      private String email;
//      private String city;
//      private String postal;
//      private String telephone;
// 
// 
//     public Customer() {
//     }
// 
//     public Customer(int customerId, String name, String lastName, String occupation, double discount,
//                     String email, String city, String postal, String telephone) {
//         this.customerId = customerId;
//         this.name = name;
//         this.lastName = lastName;
//         this.occupation = occupation;
//         this.discount = discount;
//         this.email = email;
//         this.city = city;
//         this.postal = postal;
//         this.telephone = telephone;
//     }
// 
//     public int getCustomerId() {
//         return this.customerId;
//     }
//     
//     public void setCustomerId(int customerId) {
//         this.customerId = customerId;
//     }
//     public String getName() {
//         return this.name;
//     }
//     
//     public void setName(String name) {
//         this.name = name;
//     }
//     public String getLastName() {
//         return this.lastName;
//     }
//     
//     public void setLastName(String lastName) {
//         this.lastName = lastName;
//     }
//     public String getOccupation() {
//         return this.occupation;
//     }
//     
//     public void setOccupation(String occupation) {
//         this.occupation = occupation;
//     }
//     public double getDiscount() {
//         return this.discount;
//     }
//     
//     public void setDiscount(double discount) {
//         this.discount = discount;
//     }
// 
//     public String getEmail() {
//         return email;
//     }
// 
//     public void setEmail(String email) {
//         this.email = email;
//     }
// 
//     public String getCity() {
//         return city;
//     }
// 
//     public void setCity(String city) {
//         this.city = city;
//     }
// 
//     public String getPostal() {
//         return postal;
//     }
// 
//     public void setPostal(String postal) {
//         this.postal = postal;
//     }
// 
//     public String getTelephone() {
//         return telephone;
//     }
// 
//     public void setTelephone(String telephone) {
//         this.telephone = telephone;
//     }
// }


// Path: src/main/java/com/storage/mywarehouse/ClientFrame.java
import com.storage.mywarehouse.Dao.CustomerDAO;
import com.storage.mywarehouse.Entity.Customer;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Last Name", "First Name", "Occupation", "Discount"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        jScrollPane1.setViewportView(jTable1);

        jButton1.setText("Delete Customer");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setText("Edit Customer");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);