portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r929864 - /portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedPrincipalLookupManagerAbstract.java
Date Thu, 01 Apr 2010 06:45:33 GMT
Author: taylor
Date: Thu Apr  1 06:45:33 2010
New Revision: 929864

URL: http://svn.apache.org/viewvc?rev=929864&view=rev
Log:
conforming to all uppercase tablenames

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedPrincipalLookupManagerAbstract.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedPrincipalLookupManagerAbstract.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedPrincipalLookupManagerAbstract.java?rev=929864&r1=929863&r2=929864&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedPrincipalLookupManagerAbstract.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedPrincipalLookupManagerAbstract.java
Thu Apr  1 06:45:33 2010
@@ -102,7 +102,7 @@ public abstract class JetspeedPrincipalL
 				// get the total number of results effected by the query
 				int fromPos = baseSqlStr.toUpperCase().indexOf(" FROM ");
 				if (fromPos >= 0) {
-					baseSqlStr = "select count(security_principal.principal_id)" + baseSqlStr.substring(fromPos);
+					baseSqlStr = "select count(SECURITY_PRINCIPAL.PRINCIPAL_ID)" + baseSqlStr.substring(fromPos);
 				}
 				// strip ORDER BY clause
 				int orderPos = baseSqlStr.toUpperCase().indexOf(" ORDER BY ");
@@ -143,27 +143,27 @@ public abstract class JetspeedPrincipalL
 	 */
 	protected String generateBaseSql(JetspeedPrincipalQueryContext queryContext) {
 		String attributeConstraint = null;
-		String fromPart = "security_principal";
+		String fromPart = "SECURITY_PRINCIPAL";
 		if (queryContext.getSecurityAttributes() != null) {
 			int cnt = 1;
 			for (Map.Entry<String, String> attribute : queryContext.getSecurityAttributes().entrySet())
{
 				if (attributeConstraint == null) {
-					attributeConstraint = "a" + cnt + ".PRINCIPAL_ID=security_principal.PRINCIPAL_ID AND
a" + cnt
+					attributeConstraint = "a" + cnt + ".PRINCIPAL_ID=SECURITY_PRINCIPAL.PRINCIPAL_ID AND
a" + cnt
 							+ ".ATTR_NAME = '" + attribute.getKey() + "' AND a" + cnt + ".ATTR_VALUE LIKE '"
 							+ attribute.getValue() + "'";
 				} else {
-					attributeConstraint += " AND a" + cnt + ".PRINCIPAL_ID=security_principal.PRINCIPAL_ID
AND a" + cnt
+					attributeConstraint += " AND a" + cnt + ".PRINCIPAL_ID=SECURITY_PRINCIPAL.PRINCIPAL_ID
AND a" + cnt
 							+ ".ATTR_NAME = '" + attribute.getKey() + "' AND a" + cnt + ".ATTR_VALUE LIKE '"
 							+ attribute.getValue() + "'";
 				}
-				fromPart += ", security_attribute a" + cnt;
+				fromPart += ", SECURITY_ATTRIBUTE a" + cnt;
 				cnt++;
 			}
 		}
 
 		String constraint = null;
 		if (queryContext.getNameFilter() != null && queryContext.getNameFilter().length()
> 0) {
-			constraint = "security_principal.PRINCIPAL_NAME LIKE '" + queryContext.getNameFilter().replace('*',
'%')
+			constraint = "SECURITY_PRINCIPAL.PRINCIPAL_NAME LIKE '" + queryContext.getNameFilter().replace('*',
'%')
 					+ "'";
 		}
 
@@ -178,15 +178,15 @@ public abstract class JetspeedPrincipalL
 					roleConstraints = "r" + cnt + ".ASSOC_NAME='" + JetspeedPrincipalAssociationType.IS_MEMBER_OF
 							+ "' AND r" + cnt + ".TO_PRINCIPAL_ID=rp" + cnt + ".PRINCIPAL_ID AND rp" + cnt
 							+ ".PRINCIPAL_NAME LIKE '" + roleName + "' AND rp" + cnt + ".PRINCIPAL_TYPE='role'
AND r"
-							+ cnt + ".FROM_PRINCIPAL_ID=security_principal.PRINCIPAL_ID";
+							+ cnt + ".FROM_PRINCIPAL_ID=SECURITY_PRINCIPAL.PRINCIPAL_ID";
 				} else {
 					roleConstraints = " AND r" + cnt + ".ASSOC_NAME='" + JetspeedPrincipalAssociationType.IS_MEMBER_OF
 							+ "' AND r" + cnt + ".TO_PRINCIPAL_ID=rp" + cnt + ".PRINCIPAL_ID AND rp" + cnt
 							+ ".PRINCIPAL_NAME LIKE '" + roleName + "' AND rp" + cnt + ".PRINCIPAL_TYPE='role'
AND r"
-							+ cnt + ".FROM_PRINCIPAL_ID=security_principal.PRINCIPAL_ID";
+							+ cnt + ".FROM_PRINCIPAL_ID=SECURITY_PRINCIPAL.PRINCIPAL_ID";
 				}
 			}
-			fromPart += ", security_principal_assoc r" + cnt + ", security_principal rp" + cnt;
+			fromPart += ", SECURITY_PRINCIPAL_ASSOC r" + cnt + ", SECURITY_PRINCIPAL rp" + cnt;
 			cnt++;
 		}
 
@@ -201,15 +201,15 @@ public abstract class JetspeedPrincipalL
 					groupConstraints = "r" + cnt + ".ASSOC_NAME='" + JetspeedPrincipalAssociationType.IS_MEMBER_OF
 							+ "' AND r" + cnt + ".TO_PRINCIPAL_ID=rp" + cnt + ".PRINCIPAL_ID AND rp" + cnt
 							+ ".PRINCIPAL_NAME LIKE '" + groupName + "' AND rp" + cnt + ".PRINCIPAL_TYPE='group'
AND r"
-							+ cnt + ".FROM_PRINCIPAL_ID=security_principal.PRINCIPAL_ID";
+							+ cnt + ".FROM_PRINCIPAL_ID=SECURITY_PRINCIPAL.PRINCIPAL_ID";
 				} else {
 					groupConstraints = " AND r" + cnt + ".ASSOC_NAME='" + JetspeedPrincipalAssociationType.IS_MEMBER_OF
 							+ "' AND r" + cnt + ".TO_PRINCIPAL_ID=rp" + cnt + ".PRINCIPAL_ID AND rp" + cnt
 							+ ".PRINCIPAL_NAME LIKE '" + groupName + "' AND rp" + cnt + ".PRINCIPAL_TYPE='group'
AND r"
-							+ cnt + ".FROM_PRINCIPAL_ID=security_principal.PRINCIPAL_ID";
+							+ cnt + ".FROM_PRINCIPAL_ID=SECURITY_PRINCIPAL.PRINCIPAL_ID";
 				}
 			}
-			fromPart += ", security_principal_assoc r" + cnt + ", security_principal rp" + cnt;
+			fromPart += ", SECURITY_PRINCIPAL_ASSOC r" + cnt + ", SECURITY_PRINCIPAL rp" + cnt;
 			cnt++;
 		}
 
@@ -223,15 +223,15 @@ public abstract class JetspeedPrincipalL
 					userConstraints = "r" + cnt + ".ASSOC_NAME='" + JetspeedPrincipalAssociationType.IS_MEMBER_OF
 							+ "' AND r" + cnt + ".FROM_PRINCIPAL_ID=rp" + cnt + ".PRINCIPAL_ID AND rp" + cnt
 							+ ".PRINCIPAL_NAME LIKE '" + userName + "' AND rp" + cnt + ".PRINCIPAL_TYPE='user'
AND r"
-							+ cnt + ".TO_PRINCIPAL_ID=security_principal.PRINCIPAL_ID";
+							+ cnt + ".TO_PRINCIPAL_ID=SECURITY_PRINCIPAL.PRINCIPAL_ID";
 				} else {
 					userConstraints = " AND r" + cnt + ".ASSOC_NAME='" + JetspeedPrincipalAssociationType.IS_MEMBER_OF
 							+ "' AND r" + cnt + ".FROM_PRINCIPAL_ID=rp" + cnt + ".PRINCIPAL_ID AND rp" + cnt
 							+ ".PRINCIPAL_NAME LIKE '" + userName + "' AND rp" + cnt + ".PRINCIPAL_TYPE='group'
AND r"
-							+ cnt + ".TO_PRINCIPAL_ID=security_principal.PRINCIPAL_ID";
+							+ cnt + ".TO_PRINCIPAL_ID=SECURITY_PRINCIPAL.PRINCIPAL_ID";
 				}
 			}
-			fromPart += ", security_principal_assoc r" + cnt + ", security_principal rp" + cnt;
+			fromPart += ", SECURITY_PRINCIPAL_ASSOC r" + cnt + ", SECURITY_PRINCIPAL rp" + cnt;
 			cnt++;
 		}
 
@@ -267,8 +267,8 @@ public abstract class JetspeedPrincipalL
 			}
 		}
 
-		String baseSqlStr = "SELECT security_principal.* from " + fromPart + " WHERE security_principal.PRINCIPAL_TYPE='"
-				+ queryContext.getJetspeedPrincipalType() + "' AND security_principal.DOMAIN_ID="
+		String baseSqlStr = "SELECT SECURITY_PRINCIPAL.* from " + fromPart + " WHERE SECURITY_PRINCIPAL.PRINCIPAL_TYPE='"
+				+ queryContext.getJetspeedPrincipalType() + "' AND SECURITY_PRINCIPAL.DOMAIN_ID="
 				+ queryContext.getSecurityDomain();
 		
 		if (constraint != null) {
@@ -276,9 +276,9 @@ public abstract class JetspeedPrincipalL
 		}
 		
 		if (queryContext.getOrder() != null && queryContext.getOrder().equalsIgnoreCase("desc"))
{
-			baseSqlStr += " ORDER BY security_principal.PRINCIPAL_NAME DESC";
+			baseSqlStr += " ORDER BY SECURITY_PRINCIPAL.PRINCIPAL_NAME DESC";
 		} else {
-			baseSqlStr += " ORDER BY security_principal.PRINCIPAL_NAME";
+			baseSqlStr += " ORDER BY SECURITY_PRINCIPAL.PRINCIPAL_NAME";
 		}
 		return baseSqlStr;
 	}



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message