projectwonder/wonder — pull request #324 by darkv (2012-11-20 13:57:04+00:00)
Title: Add fetching of subentity's relationships

When using inheritance you often want to fetch the root entity with a qualifier that includes attributes and relationships on subentities. Up to now if you use attributes that exist on a subentity but not on the root entity WO will figure out which entity to use to create the corresponding SQL. But this does not happen if you use a relationship that does not exist on the root entity.

Example:

Employee is a subentity of Person and defines an additional attribute _salary_ as well as a relationship _deskLocation_ to another entity.

What works:

```java
NSArray persons = Person.fetchPersons(ec, Person.NAME.is(…), null);
NSArray persons = Person.fetchPersons(ec, Employee.SALARY.greaterThan(…), null);
```
What doesn't work:

```java
NSArray persons = Person.fetchPersons(ec, Employee.DESK_LOCATION.isNull(), null);
NSArray persons = Person.fetchPersons(ec, Employee.DESK_LOCATION.dot(DeskLocation.FLOOR).is(…), null);
```

This patch adds a property _er.extensions.ERXModelGroup.advertiseRelationshipsOfSubentities_ that can be set to _true_ and defaults to _false_ to activate the patch. It will then add all relationships (EORelationship objects) of subentities to the parent's _hiddenRelationship variable. By this the relationship can be mapped to the correct subentity when creating the SQL expression.

This patch has only been tested for single table inheritance. Please test and comment :)