I did some experimentation with the technique for integrating LDAP data into XPlanner I wrote about yesterday. Unfortunately the results were not encouraging.
The JdbcLDAP Bridge does provide some basic JDBC access to LDAP. However, it has some serious limitations when used with Hibernate. The getMetaData() function returns null in the released version of the JAR although this appears to be corrected in the JdbcLDAP CVS HEAD. After building the CVS version of the bridge, the next problem I encountered was that the bridge does not support table or select field aliases. Hibernate makes extensive use of these aliases. I modified the bridge to do some rudimentary handling of the aliases and I was actually able to map XPlanner Person objects from LDAP. That was cool. However, there was one other serious problem and this one is with XPlanner. The domain objects in XPlanner use an integer as the object identifier. I don’t know of any way to map the LDAP information to an integer ID. This is a good example of the wisdom of the Hibernate team’s advice to use objects as identifiers. That way the LDAP DN could be used as the Person identifier. XPlanner’s O/R mapping was designed before Hibernate and the integers are a legacy from that time. Modifying the identifier representation would mean changing all the domain classes. In other words, it’s not a trivial change.
Another approach might be to use a Hibernate interceptor to map LDAP DNs to an XPlanner identifier as an object is loaded. Sounds like quite a hack, but it might work.
I didn’t get far enough to try the C-JDBC driver for combining LDAP and MySQL.
I’ve read that Hibernate 3 can map a single object to multiple tables. Using that feature, it might be possible to have part of the Person object in the relational database and the other part in LDAP.