acl/src/main/java/org/springframework/security/acls/jdbc/JdbcMutableAclService.java
protected Long createOrRetrieveSidPrimaryKey(String sidName, boolean sidIsPrincipal,
			boolean allowCreate) {

		List<Long> sidIds = jdbcOperations.queryForList(selectSidPrimaryKey, new Object[] {
				Boolean.valueOf(sidIsPrincipal), sidName }, Long.class);

		if (!sidIds.isEmpty()) {
			return sidIds.get(0);
		}

		if (allowCreate) {
			jdbcOperations.update(insertSid, Boolean.valueOf(sidIsPrincipal), sidName);
			Assert.isTrue(TransactionSynchronizationManager.isSynchronizationActive(),
					"Transaction must be running");
			return jdbcOperations.queryForObject(sidIdentityQuery, Long.class);
		}

		return null;
	}
protected Long createOrRetrieveSidPrimaryKey(String sidName, boolean sidIsPrincipal,
			boolean allowCreate) {

		List<Long> sidIds = jdbcOperations.queryForList(selectSidPrimaryKey, new Object[] {
				Boolean.valueOf(sidIsPrincipal), sidName }, Long.class);

		if (!sidIds.isEmpty()) {
			return sidIds.get(0);
		}

		if (allowCreate) {
			jdbcOperations.update(insertSid, Boolean.valueOf(sidIsPrincipal), sidName);
			Assert.isTrue(TransactionSynchronizationManager.isSynchronizationActive(),
					"Transaction must be running");
			return jdbcOperations.queryForObject(sidIdentityQuery, Long.class);
		}

		return null;
	}
protected Long createOrRetrieveSidPrimaryKey ( String sidName , boolean sidIsPrincipal , boolean allowCreate ) { List < Long > sidIds = jdbcOperations . queryForList ( selectSidPrimaryKey , new Object [ ] { Boolean . valueOf ( sidIsPrincipal ) , sidName } , Long . class ) ; if ( ! sidIds . isEmpty ( ) ) { return sidIds . get ( 0 ) ; } if ( allowCreate ) { jdbcOperations . update ( insertSid , Boolean . valueOf ( sidIsPrincipal ) , sidName ) ; Assert . isTrue ( TransactionSynchronizationManager . isSynchronizationActive ( ) , "Transaction must be running" ) ; return jdbcOperations . queryForObject ( sidIdentityQuery , Long . class ) ; } return null ; }
Retrieves the primary key from acl_sid, creating a new row if needed and the
allowCreate property is true.
@param sidName name of Sid to find or to create
@param sidIsPrincipal whether it's a user or granted authority like role
@param allowCreate true if creation is permitted if not found
@return the primary key or null if not found
Retrieves the primary key from acl_sid creating a new row if needed and the allowCreate property is true .