示例#1
0
  private void updatePrimaryKey(RootClass rc, PrimaryKeyInfo pki) {
    SimpleValue idValue = (SimpleValue) rc.getIdentifierProperty().getValue();

    Properties defaultStrategyProperties = new Properties();
    Property constrainedOneToOne = getConstrainedOneToOne(rc);
    if (constrainedOneToOne != null) {
      if (pki.suggestedStrategy == null) {
        idValue.setIdentifierGeneratorStrategy("foreign");
      }

      if (pki.suggestedProperties == null) {
        defaultStrategyProperties.setProperty("property", constrainedOneToOne.getName());
        idValue.setIdentifierGeneratorProperties(defaultStrategyProperties);
      }
    }
  }