acl/src/main/java/org/springframework/security/acls/jdbc/JdbcMutableAclService.java
protected Long createOrRetrieveClassPrimaryKey(String type, boolean allowCreate, Class idType) {
		List<Long> classIds = jdbcOperations.queryForList(selectClassPrimaryKey,
				new Object[] { type }, Long.class);

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

		if (allowCreate) {
			if (!isAclClassIdSupported()) {
				jdbcOperations.update(insertClass, type);
			} else {
				jdbcOperations.update(insertClass, type, idType.getCanonicalName());
			}
			Assert.isTrue(TransactionSynchronizationManager.isSynchronizationActive(),
					"Transaction must be running");
			return jdbcOperations.queryForObject(classIdentityQuery, Long.class);
		}

		return null;
	}
protected Long createOrRetrieveClassPrimaryKey(String type, boolean allowCreate, Class idType) {
		List<Long> classIds = jdbcOperations.queryForList(selectClassPrimaryKey,
				new Object[] { type }, Long.class);

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

		if (allowCreate) {
			if (!isAclClassIdSupported()) {
				jdbcOperations.update(insertClass, type);
			} else {
				jdbcOperations.update(insertClass, type, idType.getCanonicalName());
			}
			Assert.isTrue(TransactionSynchronizationManager.isSynchronizationActive(),
					"Transaction must be running");
			return jdbcOperations.queryForObject(classIdentityQuery, Long.class);
		}

		return null;
	}
protected Long createOrRetrieveClassPrimaryKey ( String type , boolean allowCreate , Class idType ) { List < Long > classIds = jdbcOperations . queryForList ( selectClassPrimaryKey , new Object [ ] { type } , Long . class ) ; if ( ! classIds . isEmpty ( ) ) { return classIds . get ( 0 ) ; } if ( allowCreate ) { if ( ! isAclClassIdSupported ( ) ) { jdbcOperations . update ( insertClass , type ) ; } else { jdbcOperations . update ( insertClass , type , idType . getCanonicalName ( ) ) ; } Assert . isTrue ( TransactionSynchronizationManager . isSynchronizationActive ( ) , "Transaction must be running" ) ; return jdbcOperations . queryForObject ( classIdentityQuery , Long . class ) ; } return null ; }
Retrieves the primary key from {@code acl_class}, creating a new row if needed and
the {@code allowCreate} property is {@code true}.

@param type to find or create an entry for (often the fully-qualified class name)
@param allowCreate true if creation is permitted if not found

@return the primary key or null if not found
Retrieves the primary key from { @code acl_class } creating a new row if needed and the { @code allowCreate } property is { @code true } .