cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Lewis <jbryanle...@gmail.com>
Subject Re: failure to commit part of the changes
Date Mon, 02 Nov 2009 22:52:10 GMT
Resending my last post.  The list rejected it as spam, probably because I
sent two posts in the same minute.


Now that I've had a day to cogitate on it and to re-read CAY-1008, the issue
> I addressed in my "model validation" code wasn't the important one.  Having
> redundant DbRelationships isn't risky; it's ony a cleanliness issue.  Having
> multiple ObjRelationships sharing the same DbRelationship is the case in the
> Jira.  I wrote a little more code today in EntityResolver to check for that:
>
>     private void validateObjLayer()
>     {
>         for (DataMap map : getDataMaps()) {
>             for (ObjEntity entity : map.getObjEntities()) {
>                 ArrayList dbpaths = new ArrayList<String>();
>                 for (ObjRelationship rel : entity.getRelationships()) {
>                     String dbpath = rel.getDbRelationshipPath();
>                     if (dbpaths.contains(dbpath)) {
>                         // Redundant ObjRelationships can lead to
> misbehavior; see CAY-1008.
>                         logger.warn("!! Found redundant ObjRelationship "
>                                 + entity.getName() + "."
>                                 + rel.getName()
>                                 + " sharing DbRel " + dbpath);
>                     }
>                     dbpaths.add(dbpath);
>                 }
>             }
>         }
>     }
>
> So you might see in the log at start-up:
>
>     !! Found redundant ObjRelationship Company.industry2 sharing DbRel
> industry
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message