private void processStartDbRelationship(Attributes atts) throws SAXException { String name = atts.getValue("", "name"); if (name == null) { throw new SAXException("MapLoader::processStartDbRelationship()," + " Unable to parse name. Attributes:\n" + printAttributes(atts).toString()); } String sourceName = atts.getValue("", "source"); if (sourceName == null) { throw new SAXException( "MapLoader::processStartDbRelationship() - null source entity"); } DbEntity source = dataMap.getDbEntity(sourceName); if (source == null) { return; } String toManyString = atts.getValue("", "toMany"); boolean toMany = toManyString != null && toManyString.equalsIgnoreCase(TRUE); String toDependPkString = atts.getValue("", "toDependentPK"); boolean toDependentPK = toDependPkString != null && toDependPkString.equalsIgnoreCase(TRUE); dbRelationship = new DbRelationship(name); dbRelationship.setSourceEntity(source); dbRelationship.setTargetEntityName(atts.getValue("", "target")); dbRelationship.setToMany(toMany); dbRelationship.setToDependentPK(toDependentPK); source.addRelationship(dbRelationship); }
private void processStartDbRelationship(Attributes atts) throws SAXException { String name = atts.getValue("", "name"); if (name == null) { throw new SAXException("MapLoader::processStartDbRelationship()," + " Unable to parse name. Attributes:\n" + printAttributes(atts)); } String sourceName = atts.getValue("", "source"); if (sourceName == null) { throw new SAXException("MapLoader::processStartDbRelationship() - null source entity"); } DbEntity source = dataMap.getDbEntity(sourceName); if (source == null) { return; } String toManyString = atts.getValue("", "toMany"); boolean toMany = toManyString != null && toManyString.equalsIgnoreCase(TRUE); String toDependPkString = atts.getValue("", "toDependentPK"); boolean toDependentPK = toDependPkString != null && toDependPkString.equalsIgnoreCase(TRUE); dbRelationship = new DbRelationship(name); dbRelationship.setSourceEntity(source); dbRelationship.setTargetEntityName(atts.getValue("", "target")); dbRelationship.setToMany(toMany); dbRelationship.setToDependentPK(toDependentPK); source.addRelationship(dbRelationship); }
relationship.setToDependentPK(false);
dbRel.setToMany(toMany); dbRel.setName(relName); dbRel.setToDependentPK(toDependentPK); dbSrc.addRelationship(dbRel);
relationship.setToDependentPK(toDependentPK); relationship.setToMany(toMany);
dbRel.setToMany(toMany); dbRel.setName(relName); dbRel.setToDependentPK(toDependentPK); dbSrc.addRelationship(dbRel);
reverse.setToDependentPK(false); rel.setToDependentPK(flag); RelationshipEvent e = new RelationshipEvent(eventSource, rel, entity); mediator.fireDbRelationshipEvent(e);
relationship.setToDependentPK(false); reverseRelationship.setToDependentPK(true);
boolean toMany = isToMany(toDependentPK, fkEntity, forwardRelationship); forwardRelationship.setToDependentPK(toDependentPK); forwardRelationship.setToMany(toMany);