1 22 23 package org.opensubsystems.blog.persist.db; 24 25 import org.opensubsystems.blog.data.Blog; 26 import org.opensubsystems.blog.persist.BlogFactory; 27 import org.opensubsystems.core.data.DataObject; 28 import org.opensubsystems.patterns.listdata.persist.db.ListDatabaseTestUtils; 29 30 38 public class BlogListDatabaseTestUtils extends ListDatabaseTestUtils 39 { 40 42 public BlogListDatabaseTestUtils( 43 ) 44 { 45 super(BlogFactory.class, BlogDatabaseSchema.class, 46 Blog.ALL_COLUMNS, Blog.COL_BLOG_FOLDER, Blog.COL_BLOG_CAPTION); 47 } 48 49 51 54 public Object insertParent( 55 int iDomainId, 56 String str1, 57 String str2 58 ) throws Exception 59 { 60 return null; 62 } 63 64 67 public void deleteParent( 68 Object parent, 69 int iDomainId 70 ) throws Exception 71 { 72 } 74 75 78 public DataObject constructData( 79 Object parent, 80 int iDomainId, 81 String str1, 82 String str2 83 ) throws Exception 84 { 85 return new Blog(DataObject.NEW_ID, iDomainId, str1, str2, str1 + str2, 86 null, null); 87 } 88 89 92 protected void deleteData( 93 Object parent, 94 final int iDomainId, 95 final String strPrefix1, 96 final String strPrefix2 97 ) throws Exception 98 { 99 deleteData(parent, iDomainId, strPrefix1, strPrefix2, 100 "DELETE FROM " + BlogDatabaseSchema.BLOG_TABLE_NAME 101 + " WHERE (FOLDER LIKE '" + strPrefix1 102 + "%' OR CAPTION LIKE '" + strPrefix2 103 + "%') AND DOMAIN_ID = " + iDomainId, 104 false); 105 } 106 107 110 public String getColumnOneValue( 111 DataObject data 112 ) 113 { 114 return ((Blog)data).getFolder(); 116 } 117 118 121 public String getColumnTwoValue( 122 DataObject data 123 ) 124 { 125 return ((Blog)data).getCaption(); 127 } 128 } 129 | Popular Tags |