Work in progress

This site is in the process of being reviewed and updated.

This is not for generic class to schema mapping but for Java bean to schema mapping. 

Introduction

Mapping a bean and its properties to an objectClass and it's attributeTypes at first appears straight forward but there are problems that arise with the object containment tree, subordinate object cardinalities, and the nature of the collections used for containment.  There really is no issue with mapping simple beans with simple data types for their properties to attributeTypes and their values in an LDAP entry.  Let's take these issues with mapping containment trees one at a time to explore what options we have available.

Cardinality Issues with the Containment of Simple Types

Not all properties of beans are single valued.  Lists, Maps, and Sets are used to contain collections of objects.  Each one of these collections impose different tactics for an LDAP mapping. 

Foo Java Bean Contains Bar Java Bean Property

A bean *Foo* may contain another subordinate bean *Bar*. For now let's presume that the cardinality is 1:1. Besides Foo containing Bar through a getBar(), setBar() pair the rest of the properties in these beans are simple data types that can easily be mapped to an LDAP attributeType.

In LDAP there is no way besides using hierarchy to show containment of this nature.  Essentially for every Foo object that is mapped to an LDAP entry via the foo objectClass, a subordinate bar entry may be added immediately below it.

This works fine for regular entries but does not apply to subentries which cannot have subordinate entries.

Because only one bar entry will exist under foo a standard cn attribute may be used as the RDN to name bar with a static value like 'barProperty'.  All Foo objects will hence have their bar entries under the foo entry with cn=barProperty as the RDN of the bar entry.

DITStructure rules can be used to enforce the subordination however ApacheDS does not support them at this point in time.

Foo Java Bean Contains Map of Primitives to Primitives

Foo Java Bean Contains Map of Primitives to Primitives

Foo Java Bean Contains List of Primitives

Lists are not?

  • No labels