I am attempting to map attributes based on database queries using org.apereo.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao.
This successfully creates an attribute for my user called "layoutNodesCount" with an integer value when I login.
I have a custom table in the uPortal database with three columns (emplid, student_group, timestamp).
I have the following bean defined in personDirectoryContext.xml:
<bean id="csucStudentGroupAttributesDao" class="org.apereo.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao">
<constructor-arg index="0" ref="PersonDB"/>
<constructor-arg>
<value>
select * CUSTOM_TABLE where {0} and STUDENT_GROUP = 'BLAH'
</value>
</constructor-arg>
<property name="usernameAttributeProvider" ref="usernameAttributeProvider"/>
<property name="queryAttributeMapping">
<map>
<entry key="emplid" value="EMPLID"/>
</map>
</property>
<property name="resultAttributeMapping">
<map>
<entry key="STUDENT_GROUP">
<set>
<value>
student_group
</value>
</set>
</entry>
</map>
</property>
</bean>
My emplid is in the table and it is an attribute successfully mapped by the LDAP Attribute mapper. The row with my student group is set to BLAH.
I have an attribute successfully created called "student_group" but it is blank instead of being set to BLAH (the value of the student_group column).
Anyone have any idea why this might be happening? I have even gone so far as to hard code the query with my emplid = 'my_emplid_here' instead of using {0} and I get the same result.
Thanks,
-Ryan