Skip Headers

# Using Java

Previous

Next

Example: Defining a variable one-to-one mapping using a unique primary key illustrates how to define a variable one-to-one mapping using a unique primary key in Java code.

Defining a variable one-to-one mapping using a unique primary key

    VariableOneToOneMapping variableOneToOneMapping = new VariableOneToOneMapping();
    variableOneToOneMapping.setAttributeName("contact");
    variableOneToOneMapping.setReferenceClass (Contact.class);
    variableOneToOneMapping.setForeignQueryKeyName ("C_ID", "id");
    variableOneToOneMapping.dontUseIndirection();
    variableOneToOneMapping.privateOwnedRelationship();