From: rk Date: Sun, 17 Feb 2002 22:33:35 +0000 (+0000) Subject: wiped AsSimpleList Methods from EntityRelation X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=b780311ca45b0653af2d73e0855cef5a91197e86;p=mir.git wiped AsSimpleList Methods from EntityRelation --- diff --git a/source/mir/entity/EntityRelation.java b/source/mir/entity/EntityRelation.java index edd296b2..5fe44f9d 100755 --- a/source/mir/entity/EntityRelation.java +++ b/source/mir/entity/EntityRelation.java @@ -98,53 +98,6 @@ public class EntityRelation { } /** - * @return Liefert eine freemarker.template.SimpleList mit den verknuepften - * Entities, wenn es sich um eine TO_MANY Liste handelt, ansonsten - * null. - */ - - public SimpleList getManyAsSimpleList(Entity entity) - throws StorageObjectException { - - if (type==TO_MANY) { - EntityList returnList = getMany(entity); - if (returnList!=null) return HTMLTemplateProcessor.makeSimpleList(returnList); - } - return null; - } - - /** - * @return Liefert eine freemarker.template.SimpleList mit den verknuepften - * Entities, wenn es sich um eine TO_MANY Liste handelt, ansonsten - * null. - */ - - public SimpleList getManyAsSimpleList(Entity entity, String order) - throws StorageObjectException { - - if (type==TO_MANY) { - EntityList returnList = getMany(entity, order); - if (returnList!=null) return HTMLTemplateProcessor.makeSimpleList(returnList); - } - return null; - } - - /** - * @return Liefert eine freemarker.template.SimpleList mit den verknuepften - * Entities, wenn es sich um eine TO_MANY Liste handelt, ansonsten - * null. - */ - - public SimpleList getManyAsSimpleList(Entity entity, String order, String whereClause) - throws StorageObjectException { - - if (type==TO_MANY) { - EntityList returnList = getMany(entity, order, whereClause); - if (returnList!=null) return HTMLTemplateProcessor.makeSimpleList(returnList); - } - return null; - } - /** * @return Liefert den Referenznamen der abhaengigen Tabelle */ diff --git a/source/mircoders/entity/EntityContent.java b/source/mircoders/entity/EntityContent.java index 958f697d..46fa13dd 100755 --- a/source/mircoders/entity/EntityContent.java +++ b/source/mircoders/entity/EntityContent.java @@ -283,7 +283,7 @@ public class EntityContent extends Entity * * @return freemarker.template.SimpleList */ - private SimpleList getComments() throws StorageObjectException { + private EntityList getComments() throws StorageObjectException { return ((DatabaseContent)theStorageObject).getComments(this); } diff --git a/source/mircoders/storage/DatabaseContent.java b/source/mircoders/storage/DatabaseContent.java index 2e3a4dcf..624b116f 100755 --- a/source/mircoders/storage/DatabaseContent.java +++ b/source/mircoders/storage/DatabaseContent.java @@ -43,7 +43,7 @@ public class DatabaseContent extends Database implements StorageObject { super(); this.theTable="content"; this.theCoreTable="media"; - + relationComments = new EntityRelation("id", "to_media", DatabaseComment.getInstance(), EntityRelation.TO_MANY); relationFeature = new EntityRelation("id", "to_feature", DatabaseFeature.getInstance(), EntityRelation.TO_ONE); try { this.theEntityClass = Class.forName("mircoders.entity.EntityContent"); } @@ -74,29 +74,15 @@ public class DatabaseContent extends Database implements StorageObject { * returns the comments that belong to the article (via entityrelation) * where db-flag is_published is true */ - public SimpleList getComments(EntityContent entC) throws StorageObjectException { - SimpleList comments=null; - try { - comments = relationComments.getManyAsSimpleList(entC,"webdb_create","is_published='1'"); - } - catch (StorageObjectException e) { - _throwStorageObjectException(e, "DatabaseComments :: failed to get comments"); - } - return comments; + public EntityList getComments(EntityContent entC) throws StorageObjectException { + return relationComments.getMany(entC,"webdb_create","is_published='1'"); } /** * returns the features that belong to the article (via entityrelation) */ - public SimpleList getFeature(EntityContent entC) throws StorageObjectException { - SimpleList feature=null; - try { - feature = relationFeature.getManyAsSimpleList(entC); - } - catch (StorageObjectException e) { - _throwStorageObjectException(e, "DatabaseComments :: failed to get features"); - } - return feature; + public EntityList getFeature(EntityContent entC) throws StorageObjectException { + return relationFeature.getMany(entC); } public boolean delete(String id) throws StorageObjectException