Index: extensions/modeshape-connector-store-jpa/src/main/java/org/modeshape/connector/store/jpa/util/StoreOptionEntity.java =================================================================== --- extensions/modeshape-connector-store-jpa/src/main/java/org/modeshape/connector/store/jpa/util/StoreOptionEntity.java (revision 1760) +++ extensions/modeshape-connector-store-jpa/src/main/java/org/modeshape/connector/store/jpa/util/StoreOptionEntity.java (working copy) @@ -45,7 +45,7 @@ import org.modeshape.connector.store.jpa.Model; public class StoreOptionEntity { @Id - @Column( name = "NAME", nullable = false, length = 512 ) + @Column( name = "NAME", nullable = false, length = 128 ) private String name; @Column( name = "VALUE", nullable = false, length = 512 ) Index: modeshape-jcr/src/main/java/org/modeshape/jcr/DefinitionCache.java =================================================================== --- modeshape-jcr/src/main/java/org/modeshape/jcr/DefinitionCache.java (revision 1760) +++ modeshape-jcr/src/main/java/org/modeshape/jcr/DefinitionCache.java (working copy) @@ -128,9 +128,13 @@ final class DefinitionCache { /* * If the child node was already defined in the type hierarchy at some other level, ignore the definition * - it was overridden by the previous definition. This relies on the fact that TypeA.getTypeAndSupertypes() - * always returns TypeX before TypeY if TypeX is closer to TypeA on the inheritance graph than TypeY is. + * always returns TypeX before TypeY if TypeX is closer to TypeA on the inheritance graph than TypeY is... + * + * ...UNLESS this is a residual definition, in which case side-by-side definitions must be allowed per 6.7.8 + * of the 1.0.1 specification. */ - if (allChildNodeDefinitions.containsKey(name) && !namesFromThisType.contains(name)) { + if (allChildNodeDefinitions.containsKey(name) && !namesFromThisType.contains(name) + && !JcrNodeType.RESIDUAL_NAME.equals(name)) { continue; } @@ -150,9 +154,13 @@ final class DefinitionCache { /* * If the property was already defined in the type hierarchy at some other level, ignore the definition * - it was overridden by the previous definition. This relies on the fact that TypeA.getTypeAndSupertypes() - * always returns TypeX before TypeY if TypeX is closer to TypeA on the inheritance graph than TypeY is. + * always returns TypeX before TypeY if TypeX is closer to TypeA on the inheritance graph than TypeY is... + * + * ...UNLESS this is a residual definition, in which case side-by-side definitions must be allowed per 6.7.8 + * of the 1.0.1 specification. */ - if (allPropertyDefinitions.containsKey(name) && !namesFromThisType.contains(name)) { + if (allPropertyDefinitions.containsKey(name) && !namesFromThisType.contains(name) + && !JcrNodeType.RESIDUAL_NAME.equals(name)) { continue; } if (definition.isMultiple()) {