Salome HOME
- Code cleanup
authormordicus <mordicus@HP-8560w>
Wed, 5 Aug 2015 20:20:45 +0000 (22:20 +0200)
committermordicus <mordicus@HP-8560w>
Wed, 5 Aug 2015 20:20:45 +0000 (22:20 +0200)
- Fix UserDao
- Fix database sequence generator
- Fix web.xml (added UserService)

projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/UserDAO.java
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/transferables/responses/CommandResultTO.java
projects/GDE_App/GDE-war/web/WEB-INF/web.xml
projects/GDE_App/GDE-war/web/index.html
projects/GDE_App/src/GDE_DB_Init.sql

index 2f9b9df0cf2b983649e1f642f3876757887134d3..a77fcbda84f242ba31d62bf64b45a557bc7ed217 100644 (file)
@@ -144,6 +144,7 @@ public class UserDAO {
      */
     public User findUser(String userName) {
         Query q = em.createNamedQuery("User.findByName");
+        q.setParameter("username", userName);
         User user = null;
         try {
             user = (User) q.getSingleResult();
index fdb97f1bd24d1f9086c5a42ca32895784947763c..642177e0c33f19e70c8da8c9129be6a29fa74f98 100644 (file)
@@ -2,7 +2,7 @@ package com.edf.gde.transferables.responses;
 
 /**
  *
- * @author mordicus
+ * @author Kavoos
  */
 public class CommandResultTO {
     public static final int OK = 1;
@@ -10,7 +10,8 @@ public class CommandResultTO {
     
     private int code;
     private String msg;
-
+    private String data;
+    
     public CommandResultTO() {
         code = OK;
     }
@@ -30,6 +31,13 @@ public class CommandResultTO {
     public void setMsg(String msg) {
         this.msg = msg;
     }
-    
+
+    public String getData() {
+        return data;
+    }
+
+    public void setData(String data) {
+        this.data = data;
+    }
     
 }
index 3ad373155f9a50aa7a4d63db2e693df881776f29..bd505850e6ff1bd140417303dbdc5b22fee01195 100644 (file)
@@ -4,10 +4,18 @@
         <servlet-name>MetadataService</servlet-name>
         <servlet-class>com.edf.gde.services.ProfileService</servlet-class>
     </servlet>
+    <servlet>
+        <servlet-name>UserServce</servlet-name>
+        <servlet-class>com.edf.gde.services.UserService</servlet-class>
+    </servlet>
     <servlet-mapping>
         <servlet-name>MetadataService</servlet-name>
         <url-pattern>/MetadataService</url-pattern>
     </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>UserServce</servlet-name>
+        <url-pattern>/UserService</url-pattern>
+    </servlet-mapping>
     <session-config>
         <session-timeout>
             30
index c627c249c7188856b64a4b709a9bb2313885c875..6f542ae80e618cd554c5ccf41ce906e8a5ad8d55 100644 (file)
@@ -1,9 +1,4 @@
 <!DOCTYPE html>
-<!--
-To change this license header, choose License Headers in Project Properties.
-To change this template file, choose Tools | Templates
-and open the template in the editor.
--->
 <html>
     <head>
         <title>TODO supply a title</title>
index 1ac70161ec465cf61ae20dbd84b5fc9d64977419..809cb64d8c1dd43c35c788079dafff19a58ab4d6 100644 (file)
@@ -1,16 +1,16 @@
 /* Unique Ids sequence generator */
 
 drop sequence SEQ_GEN_SEQUENCE;
-create sequence SEQ_GEN_SEQUENCE INCREMENT BY 50;
+create sequence SEQ_GEN_SEQUENCE START WITH 50 INCREMENT BY 50;
 
 
-DROP TABLE IF EXISTS GROUP_;
+DROP TABLE IF EXISTS GROUP_ CASCADE;
 CREATE TABLE GROUP_ (
     id bigint NOT NULL PRIMARY KEY,
     groupName varchar(255) NOT NULL
 );
 
-DROP TABLE IF EXISTS USERS;
+DROP TABLE IF EXISTS USERS CASCADE;
 CREATE TABLE USERS (
     id bigint NOT NULL PRIMARY KEY,
     userName varchar(255) not null,
@@ -18,14 +18,14 @@ CREATE TABLE USERS (
 );
 CREATE INDEX users_username_index ON USERS(userName);
 
-DROP TABLE IF EXISTS USERGROUP;
+DROP TABLE IF EXISTS USERGROUP CASCADE;
 CREATE TABLE USERGROUP (
     id bigint NOT NULL PRIMARY KEY,
     groupId bigint references GROUP_(id),
     userId bigint references USERS(id)
 );
 
-DROP TABLE IF EXISTS USERPERMISSIONS;
+DROP TABLE IF EXISTS USERPERMISSIONS CASCADE;
 CREATE TABLE USERPERMISSIONS (
     id bigint NOT NULL PRIMARY KEY,
     groupId bigint references GROUP_(id),