KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > blandware > atleap > persistence > testimonials > TestimonialDAO


1 /*
2  * Copyright 2004 Blandware (http://www.blandware.com)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package com.blandware.atleap.persistence.testimonials;
17
18 import com.blandware.atleap.common.util.PartialCollection;
19 import com.blandware.atleap.common.util.QueryInfo;
20 import com.blandware.atleap.model.testimonials.Testimonial;
21 import com.blandware.atleap.persistence.core.PageDAO;
22 import com.blandware.atleap.persistence.exception.DeleteException;
23
24 import java.util.Map JavaDoc;
25
26 /**
27  * <p>DAO for testimonials</p>
28  * <p><a HREF="TestimonialDAO.java.htm"><i>View Source</i></a></p>
29  *
30  * @author Andrey Grebnev <a HREF="mailto:andrey.grebnev@blandware.com">&lt;andrey.grebnev@blandware.com&gt;</a>
31  * @version $Revision: 1.2 $ $Date: 2005/07/29 14:12:21 $
32  */

33 public interface TestimonialDAO extends PageDAO {
34
35     // ~ CRUD methods ================================================================
36

37     /**
38      * Creates new testimonial
39      *
40      * @param testimonial Value object that represents what item must be created
41      * @param linkedObjects Map of pairs <code>uri -&gt; object<code>, which link URI in the body to
42      * corresponding object (resource or page) if it exists
43      * @return ID of created testimonial
44      */

45     public Long JavaDoc createTestimonial(Testimonial testimonial, Map JavaDoc linkedObjects);
46
47     /**
48      * Retrieves testimonial with specified ID
49      *
50      * @param testimonialId ID to search by
51      * @return Testimonial with specified ID or null if no testimonial with specified ID exists in database
52      */

53     public Testimonial retrieveTestimonial(Long JavaDoc testimonialId);
54
55     /**
56      * Retrieves lite version (with empty 'body' map) of testimonial with specified ID
57      *
58      * @param testimonialId ID to search by
59      * @return Testimonial with specified ID or null if no testimonial with specified ID exists in database
60      */

61     public Testimonial retrieveTestimonialLite(Long JavaDoc testimonialId);
62
63     /**
64      * Updates testimonial
65      *
66      * @param testimonial Testimonial to update
67      * @param linkedObjects Map of pairs <code>uri -&gt; object<code>, which link URI in the body to
68      * corresponding object (resource or page) if it exists
69      */

70     public void updateTestimonial(Testimonial testimonial, Map JavaDoc linkedObjects);
71
72     /**
73      * Deletes testimonial
74      *
75      * @param testimonial to delete
76      * @throws com.blandware.atleap.persistence.exception.DeleteException
77      * if testimonial cannot be deleted
78      */

79     public void deleteTestimonial(Testimonial testimonial) throws DeleteException;
80
81     // ~ Additional methods ================================================================
82

83     /**
84      * Retrieves filtered/sorted collection of testimonials.
85      *
86      * @param queryInfo Object that contains information about how to filter and sort data
87      * @return Collection of testimonials
88      */

89     public PartialCollection listTestimonials(QueryInfo queryInfo);
90
91
92     /**
93      * Retrieves one random active testimonial
94      *
95      * @return random testimonial or <code>null</code> if there are no active testimonials
96      */

97     public Testimonial getRandomTestimonial();
98
99     // ~ Finders ================================================================
100

101     /**
102      * Finds testimonial by URI
103      *
104      * @param testimonialUri URI of testimonial to search by
105      * @return Testimonial or null if nothing was found
106      */

107     public Testimonial findTestimonialByUri(String JavaDoc testimonialUri);
108
109 }
110
Popular Tags