private void setUpEntities(MapMessage msg) {

        String matricNum = null;
        String time = null;
        String status = null;
        String content = null;
        String comment = null;
        Connection connection = null;

        try {
            matricNum = msg.getString("matricNum");
            content = msg.getString("content");
            status = "Unread";

            Date date = new Date();
            SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy HH:mm");
            time = sdf.format(date);
            
            appeal = new AppealEntity();
            appeal.create(time, content, status, comment);
            student = findStudent(matricNum);
            appeal.setStudent(student);
            /*
            Collection<AppealEntity> appealList = student.getAppeals();
            appealList.add(appeal);
            student.setAppeals(appealList);
            */
            update();
            //em.merge(student);
            
        } catch (Exception e) {
            System.out.println("AppealMDB.setUpEntities: "
                    + "Could not create entities");
        }
        
        try { 
            connection = queueConnectionFactory.createConnection();
        } catch (Exception e) {
            System.out.println("AppealMDB.setUpEntities: " + e.toString());
        }
        finally {
            if (connection != null) {
                try {
                    connection.close();
                }
                catch (JMSException je) {
                    System.out.println("AppealMDB.JMSException caught: " + je.toString());
                }
            }
        }
    }