Salome HOME
- Sequences start at 1000 now
authorKavoos Bojnourdi <kavoos.bojnourdi@edf.fr>
Sun, 9 Aug 2015 16:16:35 +0000 (18:16 +0200)
committerKavoos Bojnourdi <kavoos.bojnourdi@edf.fr>
Sun, 9 Aug 2015 16:16:35 +0000 (18:16 +0200)
- Changed serviceName to serviceIndex in GroupPermission

projects/GDE_App/GDE-ejb/src/java/com/edf/gde/entities/GroupPermission.java
projects/GDE_App/GDE-war/test/com/edf/gde/test/dao/UserDaoTest.java
projects/GDE_App/src/GDE_DB_Init.sql

index 45518be030d1ff64c801f93a0b8d2ad56226e1b6..bf7f158c024304e0a3bd283674b7f55d8dbf0a3a 100644 (file)
@@ -42,8 +42,8 @@ public class GroupPermission implements Serializable {
     long groupId;
     @Column(name="serviceName")
     String serviceName;
-    @Column(name="methodName")
-    String methodName;
+    @Column(name="methodIndex")
+    int methodIndex;
 
     public GroupPermission() {
     }
@@ -72,13 +72,11 @@ public class GroupPermission implements Serializable {
         this.serviceName = serviceName;
     }
 
-    public String getMethodName() {
-        return methodName;
+    public int getMethodIndex() {
+        return methodIndex;
     }
 
-    public void setMethodName(String methodName) {
-        this.methodName = methodName;
+    public void setMethodIndex(int methodIndex) {
+        this.methodIndex = methodIndex;
     }
-   
-
 }
index f2080f73a08d67bafdf28831259dc0de6535b41a..578833b18bbb557a874cb26ab180a109de45750e 100644 (file)
@@ -42,6 +42,7 @@ public class UserDaoTest {
     private long createUser(String userName, String password) throws IOException {
         UserDaoClient instance = new UserDaoClient();
         long result = instance.createUser(userName, password).getId();
+        System.out.println("Created user with id " + result);
         return result;
     }
 
index ed647251dbc7d3ca94851d8670206a309e208c15..5e2992d68cb5ab75c437ea4f745d9008aa898e36 100644 (file)
@@ -1,7 +1,7 @@
 /* Unique Ids sequence generator */
 
 drop sequence SEQ_GEN_SEQUENCE;
-create sequence SEQ_GEN_SEQUENCE START WITH 100 INCREMENT BY 50;
+create sequence SEQ_GEN_SEQUENCE START WITH 1000 INCREMENT BY 50;
 
 
 DROP TABLE IF EXISTS GROUP_ CASCADE;
@@ -31,7 +31,7 @@ CREATE TABLE GROUPPERMISSIONS (
     id bigint NOT NULL PRIMARY KEY,
     groupId bigint references GROUP_(id),
     serviceName varchar(255) not null,
-    methodName varchar(255) not null
+    methodIndex int not null
 );
 
 /* METADATA */
@@ -110,8 +110,8 @@ CREATE TABLE profile_attribute (
     profile_id bigint REFERENCES profile (id)
 );
 
--- The 50 first id are reserved for initial data
-INSERT INTO users (id,username,userpassword) VALUES (0,'admin','edf123');
+-- The 1000 first ids are reserved for initial data
+INSERT INTO users (id,username,userpassword) VALUES (1,'admin','edf123');
 INSERT INTO group_ (id,groupname) VALUES (1,'admins');
-INSERT into usergroup(id,groupid,userid) VALUES (2,1,0);
-
+INSERT into usergroup(id,groupid,userid) VALUES (2,1,1);
+INSERT INTO grouppermissions (id,groupid,servicename,methodname) VALUES (3, 1, 'UserService','CREATEUSER');