}
/**
- * @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
*/
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"); }
* 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