/** * Returns ObjAttribute of this entity that maps to <code>dbAttribute</code> * parameter. Returns null if no such attribute is found. */ public ObjAttribute getAttributeForDbAttribute(DbAttribute dbAttribute) { for (ObjAttribute next : getAttributeMap().values()) { if (next instanceof EmbeddedAttribute) { ObjAttribute embeddedAttribute = ((EmbeddedAttribute) next) .getAttributeForDbPath(dbAttribute.getName()); if (embeddedAttribute != null) { return embeddedAttribute; } } else { if (next.getDbAttribute() == dbAttribute) { return next; } } } return null; }