svn-gvsig-desktop / trunk / libraries / libAuthenticationService / src / com / iver / cit / gvsig / authentication / db / QueryBuilder.java @ 4217
History | View | Annotate | Download (1.89 KB)
1 |
package com.iver.cit.gvsig.authentication.db; |
---|---|
2 |
|
3 |
public class QueryBuilder |
4 |
{ |
5 |
//DB table/ field names...
|
6 |
public static final String USER_TABLE = "users"; |
7 |
public static final String USER_USR_COL = "name"; |
8 |
public static final String USER_PWD_COL = "pwd"; |
9 |
|
10 |
public static final String USER_ROLES_TABLE = "users_roles"; |
11 |
public static final String USER_ROLES_ROLES_ID_COL = "roles_id"; |
12 |
public static final String USER_ROLES_USERS_ID_COL = "users_id"; |
13 |
|
14 |
public static final String ROLES_TABLE = "roles"; |
15 |
public static final String ROLES_TABLE_ID_COL = "id"; |
16 |
public static final String ROLES_TABLE_NAME_COL = "name"; |
17 |
|
18 |
public static final String ROLE_GRANTS_TABLE = "role_grants"; |
19 |
public static final String ROLE_GRANTS_GRANTS_ID_COL = "grants_2_id"; |
20 |
public static final String ROLE_GRANTS_ROLES_ID_COL = "roles_id"; |
21 |
|
22 |
public static final String GRANTS_TABLE = "grants2"; |
23 |
public static final String GRANTS_ID_COL = "id"; |
24 |
public static final String GRANTS_TYPE_COL = "typegrant"; //comprobar en BD!!!! |
25 |
public static final String GRANTS_DATA_COL = "data"; |
26 |
|
27 |
public static final String GRANT_TYPE_TABLE = "granttype"; |
28 |
public static final String GRANT_TYPE_ID_COL = "id"; |
29 |
public static final String GRANT_TYPE_DESCRIPTION_COL = "description"; |
30 |
public static final String GRANT_TYPE_NAME_COL = "name"; |
31 |
|
32 |
public static final String USER_ID = ""; |
33 |
public static String getLoginQuery(String usr, String pwd) |
34 |
{ |
35 |
StringBuffer query = new StringBuffer("SELECT * from ") |
36 |
.append(USER_TABLE).append(" WHERE ").append(USER_USR_COL).append("'" + usr + "' and ") |
37 |
.append(USER_PWD_COL).append("'" + pwd + "'"); |
38 |
return query.toString();
|
39 |
} |
40 |
|
41 |
public static String getUserRolesIds(String userId) |
42 |
{ |
43 |
StringBuffer query = new StringBuffer("SELECT * from "); |
44 |
return query.toString();
|
45 |
} |
46 |
|
47 |
public static String getGvSigConfigQuery() |
48 |
{ |
49 |
return ""; |
50 |
} |
51 |
|
52 |
|
53 |
public static String getMapConfigQuery() |
54 |
{ |
55 |
return ""; |
56 |
} |
57 |
} |