diff options
Diffstat (limited to 'projects/net.wotonomy.persistence/src/main/java/net/wotonomy/access/EODatabase.java')
| -rw-r--r-- | projects/net.wotonomy.persistence/src/main/java/net/wotonomy/access/EODatabase.java | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/projects/net.wotonomy.persistence/src/main/java/net/wotonomy/access/EODatabase.java b/projects/net.wotonomy.persistence/src/main/java/net/wotonomy/access/EODatabase.java index a9177c5..a995290 100644 --- a/projects/net.wotonomy.persistence/src/main/java/net/wotonomy/access/EODatabase.java +++ b/projects/net.wotonomy.persistence/src/main/java/net/wotonomy/access/EODatabase.java @@ -28,11 +28,11 @@ import net.wotonomy.foundation.NSMutableDictionary; import net.wotonomy.foundation.NSTimestamp; /** -* -* @author ezamudio@nasoft.com -* @author $Author: cgruber $ -* @version $Revision: 894 $ -*/ + * + * @author ezamudio@nasoft.com + * @author $Author: cgruber $ + * @version $Revision: 894 $ + */ public class EODatabase { protected EOAdaptor _adaptor; @@ -98,10 +98,10 @@ public class EODatabase { public EOEntity entityForObject(EOEnterpriseObject eo) { String cname = eo.getClass().getName(); for (int i = 0; i < _models.count(); i++) { - EOModel m = (EOModel)_models.objectAtIndex(i); + EOModel m = (EOModel) _models.objectAtIndex(i); NSArray ents = m.entities(); for (int j = 0; j < ents.count(); j++) { - EOEntity e = (EOEntity)ents.objectAtIndex(i); + EOEntity e = (EOEntity) ents.objectAtIndex(i); if (e.className().equals(cname)) return e; } @@ -111,10 +111,10 @@ public class EODatabase { public EOEntity entityNamed(String name) { for (int i = 0; i < _models.count(); i++) { - EOModel m = (EOModel)_models.objectAtIndex(i); + EOModel m = (EOModel) _models.objectAtIndex(i); NSArray ents = m.entities(); for (int j = 0; j < ents.count(); j++) { - EOEntity e = (EOEntity)ents.objectAtIndex(i); + EOEntity e = (EOEntity) ents.objectAtIndex(i); if (e.name().equals(name)) return e; } @@ -132,13 +132,13 @@ public class EODatabase { public void forgetSnapshotsForGlobalIDs(NSArray gids) { for (int i = 0; i < gids.count(); i++) - forgetSnapshotForGlobalID((EOGlobalID)gids.objectAtIndex(i)); + forgetSnapshotForGlobalID((EOGlobalID) gids.objectAtIndex(i)); } public void handleDroppedConnection() { adaptor().handleDroppedConnection(); for (int i = 0; i < _contexts.count(); i++) { - EODatabaseContext c = (EODatabaseContext)_contexts.objectAtIndex(i); + EODatabaseContext c = (EODatabaseContext) _contexts.objectAtIndex(i); c.handleDroppedConnection(); } } @@ -160,7 +160,7 @@ public class EODatabase { } public void recordSnapshotForSourceGlobalID(NSArray gids, EOGlobalID gid, String name) { - NSMutableDictionary d = (NSMutableDictionary)_snapshots.objectForKey(gid); + NSMutableDictionary d = (NSMutableDictionary) _snapshots.objectForKey(gid); if (d == null) { d = new NSMutableDictionary(); _snapshots.setObjectForKey(d, gid); @@ -175,12 +175,12 @@ public class EODatabase { public void recordToManySnapshots(NSDictionary snaps) { Enumeration enumeration = snaps.keyEnumerator(); while (enumeration.hasMoreElements()) { - EOGlobalID gid = (EOGlobalID)enumeration.nextElement(); - NSDictionary rels = (NSDictionary)snaps.objectForKey(gid); + EOGlobalID gid = (EOGlobalID) enumeration.nextElement(); + NSDictionary rels = (NSDictionary) snaps.objectForKey(gid); Enumeration relEnum = rels.keyEnumerator(); while (relEnum.hasMoreElements()) { - String relName = (String)relEnum.nextElement(); - NSArray gids = (NSArray)rels.objectForKey(relName); + String relName = (String) relEnum.nextElement(); + NSArray gids = (NSArray) rels.objectForKey(relName); recordSnapshotForSourceGlobalID(gids, gid, relName); } } @@ -203,7 +203,7 @@ public class EODatabase { } public NSArray resultCacheForEntityNamed(String name) { - return (NSArray)_resultCache.objectForKey(name); + return (NSArray) _resultCache.objectForKey(name); } public void setResultCache(NSArray cache, String entityName) { @@ -215,7 +215,7 @@ public class EODatabase { } public NSDictionary snapshotForGlobalID(EOGlobalID gid) { - return (NSDictionary)_snapshots.objectForKey(gid); + return (NSDictionary) _snapshots.objectForKey(gid); } public NSDictionary snapshotForGlobalID(EOGlobalID gid, long l) { @@ -223,10 +223,10 @@ public class EODatabase { } public NSArray snapshotForSourceGlobalID(EOGlobalID gid, String name) { - NSDictionary d = (NSDictionary)_snapshots.objectForKey(gid); + NSDictionary d = (NSDictionary) _snapshots.objectForKey(gid); if (d == null) return null; - return (NSArray)d.objectForKey(name); + return (NSArray) d.objectForKey(name); } public NSDictionary snapshotForSourceGlobalID(EOGlobalID gid, String s, long l) { @@ -247,21 +247,21 @@ public class EODatabase { } /* - * $Log$ - * Revision 1.2 2006/02/16 16:47:13 cgruber - * Move some classes in to "internal" packages and re-work imports, etc. + * $Log$ Revision 1.2 2006/02/16 16:47:13 cgruber Move some classes in to + * "internal" packages and re-work imports, etc. * - * Also use UnsupportedOperationExceptions where appropriate, instead of WotonomyExceptions. + * Also use UnsupportedOperationExceptions where appropriate, instead of + * WotonomyExceptions. * - * Revision 1.1 2006/02/16 13:19:57 cgruber - * Check in all sources in eclipse-friendly maven-enabled packages. + * Revision 1.1 2006/02/16 13:19:57 cgruber Check in all sources in + * eclipse-friendly maven-enabled packages. * - * Revision 1.2 2005/05/11 15:21:53 cgruber - * Change enum to enumeration, since enum is now a keyword as of Java 5.0 + * Revision 1.2 2005/05/11 15:21:53 cgruber Change enum to enumeration, since + * enum is now a keyword as of Java 5.0 * * A few other comments in the code. * - * Revision 1.1 2003/08/19 01:54:43 chochos - * The EODatabase layer still needs a lot of work, but it's on its way... + * Revision 1.1 2003/08/19 01:54:43 chochos The EODatabase layer still needs a + * lot of work, but it's on its way... * */
\ No newline at end of file |
