org.unitedfront2.dao
インタフェース BlogDao

すべてのスーパーインタフェース:
Dao, Registerable<Blog>, SimpleDeletable, SimpleFindable<Blog>, Updatable<Blog>
既知の実装クラスの一覧:
BlogDaoImpl

public interface BlogDao
extends Registerable<Blog>, SimpleFindable<Blog>, Updatable<Blog>, SimpleDeletable, Dao

ブログのデータアクセスインターフェースです。

作成者:
kurokkie

メソッドの概要
 int countBlogEntry(int blogId)
          ブログが持つブログ記事の数を取得します。
 int countComment(int blogEntryId)
          ブログ記事が持つコメント数を取得します。
 void delete(int blogId)
          指定した主キーを持つデータを削除します。
 void deleteBlogEntry(int entryId)
          指定したブログ記事を削除します。
 List<BlogEntry> findBlogEntries(int blogId, int no, int num)
          指定した範囲のブログ記事を取得します。
 Blog findByCode(String code)
          コードを指定してブログを取得します。
 List<Blog> findByOwnerId(int ownerId)
          指定した所有者のブログリストを取得します。
 List<Comment> findComments(int entryId)
          指定したブログ記事のコメントを取得します。
 List<Blog> findPublicBlogs()
          匿名ユーザに公開しているブログを取得します。
 List<Blog> findPublicBlogsRandomly(int max)
          匿名ユーザに公開しているブログを取得します。
 void registerBlogEntry(int blogId, int entryId)
          指定したブログに指定した記事を登録します。
 void registerComment(int entryId, int commentId)
          指定した記事にコメントを登録します。
 
インタフェース org.unitedfront2.dao.Registerable から継承されたメソッド
register
 
インタフェース org.unitedfront2.dao.SimpleFindable から継承されたメソッド
find
 
インタフェース org.unitedfront2.dao.Updatable から継承されたメソッド
update
 
インタフェース org.unitedfront2.dao.Dao から継承されたメソッド
getCurrentDate
 

メソッドの詳細

registerBlogEntry

void registerBlogEntry(int blogId,
                       int entryId)
指定したブログに指定した記事を登録します。

パラメータ:
blogId - ブログ ID
entryId - ブログ記事 ID (メッセージ ID)

registerComment

void registerComment(int entryId,
                     int commentId)
指定した記事にコメントを登録します。

パラメータ:
entryId - ブログ記事 ID (メッセージ ID)
commentId - コメント ID

findByCode

Blog findByCode(String code)
コードを指定してブログを取得します。

パラメータ:
code - コード
戻り値:
ブログ、見つからなければ null

findByOwnerId

List<Blog> findByOwnerId(int ownerId)
指定した所有者のブログリストを取得します。

パラメータ:
ownerId - 所有者のユーザ ID
戻り値:
ブログリスト

findPublicBlogs

List<Blog> findPublicBlogs()
匿名ユーザに公開しているブログを取得します。返り値のリストは登録日の降順。

戻り値:
ブログリスト

findPublicBlogsRandomly

List<Blog> findPublicBlogsRandomly(int max)
匿名ユーザに公開しているブログを取得します。

パラメータ:
max - 最大件数
戻り値:
ブログリスト

delete

void delete(int blogId)
インタフェース SimpleDeletable の記述:
指定した主キーを持つデータを削除します。削除対象となるドメインオブジェクトのプロパティとなるドメインオブ ジェクトも 極力 削除されます。プロパティとなるドメインオブジェクトが他のドメイン オブジェクトからも参照されている場合などは削除されない可能性があります。

定義:
インタフェース SimpleDeletable 内の delete
パラメータ:
blogId - 主キー
'事前条件:'
ブログが記事を一つも持っていない
'事後条件:'
ブログに関連するオブジェクトも削除される

countBlogEntry

int countBlogEntry(int blogId)
ブログが持つブログ記事の数を取得します。

パラメータ:
blogId - ブログ ID
戻り値:
ブログ記事数

countComment

int countComment(int blogEntryId)
ブログ記事が持つコメント数を取得します。

パラメータ:
blogEntryId - ブログ記事 ID
戻り値:
コメント数

findBlogEntries

List<BlogEntry> findBlogEntries(int blogId,
                                int no,
                                int num)
指定した範囲のブログ記事を取得します。記事番号は0から始まる整数で、ID の降順になります。

パラメータ:
blogId - ブログ ID
no - 開始点となる記事番号
num - 件数
戻り値:
ブログ記事リスト

findComments

List<Comment> findComments(int entryId)
指定したブログ記事のコメントを取得します。

パラメータ:
entryId - ブログ記事 ID (メッセージ ID)
戻り値:
コメントリスト

deleteBlogEntry

void deleteBlogEntry(int entryId)
指定したブログ記事を削除します。ブログ記事に付属するコメントも削除されます。

パラメータ:
entryId - ブログ記事 ID


Copyright © 2007-2008 www.unitedfront2.org. All Rights Reserved.