// Path: StoreModel.java
// public class StoreModel {
//     private HibernateConfig theHibernateConfiguration;
//     public StoreModel(){
//        this.theHibernateConfiguration = new HibernateConfig();
//     }
//     public void addUser(User aUser){
//         Session theSession = this.theHibernateConfiguration.getCurrentSession();
//         Transaction transaction = theSession.beginTransaction();
//         theSession.save(aUser);
//         transaction.commit();
//     }
//     public void updateUser(User aUser){
//         Session theSession = this.theHibernateConfiguration.getCurrentSession();
//         Transaction transaction = theSession.beginTransaction();
//         theSession.merge(aUser);
//         transaction.commit();
//     }
// 
//     public ArrayList getAllUsers(){
//         return this.getAll("");
//     }
//     public ArrayList getAllCustomers(){
//         return this.getAll(" where u.manager_level == 0");
//     }
//     public ArrayList getAllManagers(){
//         return this.getAll(" where u.manager_level > 0");
//     }
//     public ArrayList getAllManagersByLevel(int aLevel){
//         return this.getAll(" where u.manager_level == "+aLevel);
//     }
//     private ArrayList getAll(String whereClause){
//         Session theSession = this.theHibernateConfiguration.getCurrentSession();
//         Transaction transaction = theSession.beginTransaction();
//         Query allUsersQuery = theSession.createQuery("select u from User as u order by u.id" + whereClause);
//         List userList = allUsersQuery.list();
//         return new ArrayList(userList);
//     }
// 
//     public User getUser(String aName, String aPassword){
//         Session theSession = this.theHibernateConfiguration.getCurrentSession();
//         Transaction transaction = theSession.beginTransaction();
//         Query singleUserQuery = theSession.createQuery("select u from User as u where u.uname="+aName+ "and u.pword = "+aPassword);
//         User theUser = (User)singleUserQuery.uniqueResult();
//         return theUser;
//     }
//     public User getUserBySessionID(String aSessionID){
//         Session theSession = this.theHibernateConfiguration.getCurrentSession();
//         Transaction transaction = theSession.beginTransaction();
//         Query singleUserQuery = theSession.createQuery("select u from User as u where u.session="+aSessionID);
//         User theUser = (User)singleUserQuery.uniqueResult();
//         return theUser;
//     }
// }
// 
// Path: User.java
// @Entity
// @Table(name = "app_user")
// public class User {
//     
//     @Id
//     @GeneratedValue
//     private Integer id;
//     private String uname;
//     private String pword;
//     private int active;
//     private int manager_level;
//     private String session;
//     
//     /*
//      * one User can have many phone numbers.  CascadeType.ALL causes associated
//      * phone numbers to be deleted when a User is deleted.
//      */
//     @ManyToMany(cascade=CascadeType.ALL)
//     @JoinTable(
//                name="user_number",
//                joinColumns = { @JoinColumn( name="user_id") },
//                inverseJoinColumns = @JoinColumn( name="phone_id")
//                )
//     private Set<PhoneNumber> phoneNumbers;
//     public User() {
//     	this.active = 1;
//         this.manager_level = 0;
//         this.session = "";
//     }
// 
//     @Override
//     public String toString() {
//         return "User{" +
//                 "id=" + id +
//                 ", uname='" + uname + '\'' +
//                 ", pword='" + pword + '\'' +
//                 ", active=" + active +
//                 ", manager_level=" + manager_level +
//                 ", session='" + session + '\'' +
//                 ", phoneNumbers=" + phoneNumbers +
//                 '}';
//     }
// 
//     public Integer getId() {
//         return id;
//     }
//     public void setId(Integer id) {
//         this.id = id;
//     }
//     public String getUname() {
//         return uname;
//     }
//     public void setUname(String uname) {
//         this.uname = uname;
//     }
//     public String getPword() {
//         return pword;
//     }
//     public void setPword(String pword) {
//         this.pword = pword;
//     }
//     public Set<PhoneNumber> getPhoneNumbers() {
//         return phoneNumbers;
//     }
// 
//     public int getManager_level() {
//         return manager_level;
//     }
// 
//     public void setManager_level(int manager_level) {
//         this.manager_level = manager_level;
//     }
// 
//     public String getSession() {
//         return session;
//     }
// 
//     public void setSession(String session) {
//         this.session = session;
//     }
// 
//     public void setActive(int anIndicator){
//         this.active = anIndicator;
//     }
// 
//     public int getActive(){
//         return this.active;
//     }
// }


import com.doing.more.java.example.StoreModel;
import com.doing.more.java.example.User;
import com.doing.more.java.example.appcontrol.Handler;
import json.JSONOutputStream;
import java.util.HashMap;
import java.util.UUID;
package com.doing.more.java.example.handlers;



public class RegistrationHandler implements Handler {
    @Override
    public void handleIt(HashMap<String, Object> dataMap) {
        String userName = (String)dataMap.get("uname");
        String password = (String)dataMap.get("pword");
// Path: StoreModel.java
// public class StoreModel {
//     private HibernateConfig theHibernateConfiguration;
//     public StoreModel(){
//        this.theHibernateConfiguration = new HibernateConfig();
//     }
//     public void addUser(User aUser){
//         Session theSession = this.theHibernateConfiguration.getCurrentSession();
//         Transaction transaction = theSession.beginTransaction();
//         theSession.save(aUser);
//         transaction.commit();
//     }
//     public void updateUser(User aUser){
//         Session theSession = this.theHibernateConfiguration.getCurrentSession();
//         Transaction transaction = theSession.beginTransaction();
//         theSession.merge(aUser);
//         transaction.commit();
//     }
// 
//     public ArrayList getAllUsers(){
//         return this.getAll("");
//     }
//     public ArrayList getAllCustomers(){
//         return this.getAll(" where u.manager_level == 0");
//     }
//     public ArrayList getAllManagers(){
//         return this.getAll(" where u.manager_level > 0");
//     }
//     public ArrayList getAllManagersByLevel(int aLevel){
//         return this.getAll(" where u.manager_level == "+aLevel);
//     }
//     private ArrayList getAll(String whereClause){
//         Session theSession = this.theHibernateConfiguration.getCurrentSession();
//         Transaction transaction = theSession.beginTransaction();
//         Query allUsersQuery = theSession.createQuery("select u from User as u order by u.id" + whereClause);
//         List userList = allUsersQuery.list();
//         return new ArrayList(userList);
//     }
// 
//     public User getUser(String aName, String aPassword){
//         Session theSession = this.theHibernateConfiguration.getCurrentSession();
//         Transaction transaction = theSession.beginTransaction();
//         Query singleUserQuery = theSession.createQuery("select u from User as u where u.uname="+aName+ "and u.pword = "+aPassword);
//         User theUser = (User)singleUserQuery.uniqueResult();
//         return theUser;
//     }
//     public User getUserBySessionID(String aSessionID){
//         Session theSession = this.theHibernateConfiguration.getCurrentSession();
//         Transaction transaction = theSession.beginTransaction();
//         Query singleUserQuery = theSession.createQuery("select u from User as u where u.session="+aSessionID);
//         User theUser = (User)singleUserQuery.uniqueResult();
//         return theUser;
//     }
// }
// 
// Path: User.java
// @Entity
// @Table(name = "app_user")
// public class User {
//     
//     @Id
//     @GeneratedValue
//     private Integer id;
//     private String uname;
//     private String pword;
//     private int active;
//     private int manager_level;
//     private String session;
//     
//     /*
//      * one User can have many phone numbers.  CascadeType.ALL causes associated
//      * phone numbers to be deleted when a User is deleted.
//      */
//     @ManyToMany(cascade=CascadeType.ALL)
//     @JoinTable(
//                name="user_number",
//                joinColumns = { @JoinColumn( name="user_id") },
//                inverseJoinColumns = @JoinColumn( name="phone_id")
//                )
//     private Set<PhoneNumber> phoneNumbers;
//     public User() {
//     	this.active = 1;
//         this.manager_level = 0;
//         this.session = "";
//     }
// 
//     @Override
//     public String toString() {
//         return "User{" +
//                 "id=" + id +
//                 ", uname='" + uname + '\'' +
//                 ", pword='" + pword + '\'' +
//                 ", active=" + active +
//                 ", manager_level=" + manager_level +
//                 ", session='" + session + '\'' +
//                 ", phoneNumbers=" + phoneNumbers +
//                 '}';
//     }
// 
//     public Integer getId() {
//         return id;
//     }
//     public void setId(Integer id) {
//         this.id = id;
//     }
//     public String getUname() {
//         return uname;
//     }
//     public void setUname(String uname) {
//         this.uname = uname;
//     }
//     public String getPword() {
//         return pword;
//     }
//     public void setPword(String pword) {
//         this.pword = pword;
//     }
//     public Set<PhoneNumber> getPhoneNumbers() {
//         return phoneNumbers;
//     }
// 
//     public int getManager_level() {
//         return manager_level;
//     }
// 
//     public void setManager_level(int manager_level) {
//         this.manager_level = manager_level;
//     }
// 
//     public String getSession() {
//         return session;
//     }
// 
//     public void setSession(String session) {
//         this.session = session;
//     }
// 
//     public void setActive(int anIndicator){
//         this.active = anIndicator;
//     }
// 
//     public int getActive(){
//         return this.active;
//     }
// }


// Path: RegistrationHandler.java
import com.doing.more.java.example.StoreModel;
import com.doing.more.java.example.User;
import com.doing.more.java.example.appcontrol.Handler;
import json.JSONOutputStream;
import java.util.HashMap;
import java.util.UUID;

package com.doing.more.java.example.handlers;



public class RegistrationHandler implements Handler {
    @Override
    public void handleIt(HashMap<String, Object> dataMap) {
        String userName = (String)dataMap.get("uname");
        String password = (String)dataMap.get("pword");
        StoreModel theModel = (StoreModel)dataMap.get("model");