/** * Returns an ObjEntity stripped of any server-side information, such as DbEntity * mapping. "clientClassName" property of this entity is used to intialize "className" * property of returned entity. * * @since 1.2 */ public ObjEntity getClientEntity() { ObjEntity entity = new ObjEntity(getName()); entity.setClassName(getClientClassName()); entity.setSuperClassName(getClientSuperClassName()); entity.setSuperEntityName(getSuperEntityName()); // TODO: should we also copy lock type? // copy attributes Iterator attributes = getDeclaredAttributes().iterator(); while (attributes.hasNext()) { ObjAttribute attribute = (ObjAttribute) attributes.next(); entity.addAttribute(attribute.getClientAttribute()); } // copy relationships Iterator relationships = getDeclaredRelationships().iterator(); while (relationships.hasNext()) { ObjRelationship relationship = (ObjRelationship) relationships.next(); entity.addRelationship(relationship.getClientRelationship()); } return entity; }
ObjAttribute clientAttribute = attribute.getClientAttribute(); entity.addAttribute(clientAttribute); ObjAttribute clientAttribute = attribute.getClientAttribute(); clientPK.add(clientAttribute);