001// ______________________________________________________
002// Generated by sql2java - https://github.com/10km/sql2java 
003// JDBC driver used at code generation time: com.mysql.jdbc.Driver
004// template: manager.interface.java.vm
005// ______________________________________________________
006package net.gdface.facedb.db;
007import gu.sql2java.TableManager;
008import gu.sql2java.exception.ObjectRetrievalException;
009import gu.sql2java.exception.RuntimeDaoException;
010
011/**
012 * Interface to handle database calls (save, load, count, etc...) for the fd_face table.<br>
013 * Remarks: 人脸检测信息数据表,用于保存检测到的人脸的所有信息(特征数据除外)
014 * @author guyadong
015 */
016public interface IFaceManager extends TableManager<FaceBean>
017{  
018    //////////////////////////////////////
019    // PRIMARY KEY METHODS
020    //////////////////////////////////////
021
022    //1
023    /**
024     * Loads a {@link FaceBean} from the fd_face using primary key fields.
025     *
026     * @param id Integer - PK# 1
027     * @return a unique FaceBean or {@code null} if not found
028     * @throws RuntimeDaoException
029     */
030    public FaceBean loadByPrimaryKey(Integer id)throws RuntimeDaoException;
031
032    //1.1
033    /**
034     * Loads a {@link FaceBean} from the fd_face using primary key fields.
035     *
036     * @param id Integer - PK# 1
037     * @return a unique FaceBean
038     * @throws ObjectRetrievalException if not found
039     * @throws RuntimeDaoException
040     */
041    public FaceBean loadByPrimaryKeyChecked(Integer id) throws RuntimeDaoException,ObjectRetrievalException;
042    
043    //1.4
044    /**
045     * check if contains row with primary key fields.
046     * @param id Integer - PK# 1
047     * @return true if this fd_face contains row with primary key fields.
048     * @throws RuntimeDaoException
049     */
050    public boolean existsPrimaryKey(Integer id)throws RuntimeDaoException;
051    //1.4.1
052    /**
053     * Check duplicated row by primary keys,if row exists throw exception
054     * @param id primary keys
055     * @return id
056     * @throws RuntimeDaoException
057     * @throws ObjectRetrievalException
058     */
059    public Integer checkDuplicate(Integer id)throws RuntimeDaoException,ObjectRetrievalException;
060    //1.8
061    /**
062     * Loads {@link FaceBean} from the fd_face using primary key fields.
063     *
064     * @param keys primary keys array
065     * @return list of FaceBean
066     * @throws RuntimeDaoException
067     */
068    public java.util.List<FaceBean> loadByPrimaryKey(Integer... keys)throws RuntimeDaoException;
069    //1.9
070    /**
071     * Loads {@link FaceBean} from the fd_face using primary key fields.
072     *
073     * @param keys primary keys collection
074     * @return list of FaceBean
075     * @throws RuntimeDaoException
076     */
077    public java.util.List<FaceBean> loadByPrimaryKey(java.util.Collection<Integer> keys)throws RuntimeDaoException;
078    //2
079    /**
080     * Delete row according to its primary keys.<br>
081     * all keys must not be null
082     *
083     * @param id Integer - PK# 1
084     * @return the number of deleted rows
085     * @throws RuntimeDaoException
086     */
087    public int deleteByPrimaryKey(Integer id)throws RuntimeDaoException;
088    //2.2
089    /**
090     * Delete rows according to primary key.<br>
091     *
092     * @param keys primary keys array
093     * @return the number of deleted rows
094     * @throws RuntimeDaoException
095     * @see #delete(gu.sql2java.BaseBean)
096     */
097    public int deleteByPrimaryKey(Integer... keys)throws RuntimeDaoException;
098    //2.3
099    /**
100     * Delete rows according to primary key.<br>
101     *
102     * @param keys primary keys collection
103     * @return the number of deleted rows
104     * @throws RuntimeDaoException
105     * @see #delete(gu.sql2java.BaseBean)
106     */
107    public int deleteByPrimaryKey(java.util.Collection<Integer> keys)throws RuntimeDaoException;
108 
109    //3.5 SYNC SAVE 
110    /**
111     * Save the FaceBean bean and referenced beans and imported beans into the database.
112     *
113     * @param bean the {@link FaceBean} bean to be saved
114     * @param refFeatureByFeatureMd5 the {@link FeatureBean} bean referenced by {@link FaceBean} 
115     * @param refImageByImageMd5 the {@link ImageBean} bean referenced by {@link FaceBean} 
116         * @return the inserted or updated {@link FaceBean} bean
117     * @throws RuntimeDaoException
118     */
119    public FaceBean save(FaceBean bean
120        , FeatureBean refFeatureByFeatureMd5 , ImageBean refImageByImageMd5 
121        )throws RuntimeDaoException;
122    //3.6 SYNC SAVE AS TRANSACTION
123    /**
124     * Transaction version for sync save<br>
125     * see also {@link #save(FaceBean , FeatureBean , ImageBean )}
126     * @param bean the {@link FaceBean} bean to be saved
127     * @param refFeatureByFeatureMd5 the {@link FeatureBean} bean referenced by {@link FaceBean} 
128     * @param refImageByImageMd5 the {@link ImageBean} bean referenced by {@link FaceBean} 
129         * @return the inserted or updated {@link FaceBean} bean
130     * @throws RuntimeDaoException
131     */
132    public FaceBean saveAsTransaction(final FaceBean bean
133        ,final FeatureBean refFeatureByFeatureMd5 ,final ImageBean refImageByImageMd5 
134        )throws RuntimeDaoException;
135      //////////////////////////////////////
136    // GET/SET FOREIGN KEY BEAN METHOD
137    //////////////////////////////////////
138    //5.1 GET REFERENCED VALUE
139    /**
140     * Retrieves the {@link FeatureBean} object referenced by {@link FaceBean#getFeatureMd5}() field.<br>
141     * FK_NAME : fd_face_ibfk_2
142     * @param bean the {@link FaceBean}
143     * @return the associated {@link FeatureBean} bean or {@code null} if {@code bean} is {@code null}
144     * @throws RuntimeDaoException
145     */
146    public FeatureBean getReferencedByFeatureMd5(FaceBean bean)throws RuntimeDaoException;
147
148    //5.2 SET REFERENCED 
149    /**
150     * Associates the {@link FaceBean} object to the {@link FeatureBean} object by {@link FaceBean#getFeatureMd5}() field.
151     *
152     * @param bean the {@link FaceBean} object to use
153     * @param beanToSet the {@link FeatureBean} object to associate to the {@link FaceBean}
154     * @return always beanToSet saved
155     * @throws RuntimeDaoException
156     */
157    public FeatureBean setReferencedByFeatureMd5(FaceBean bean, FeatureBean beanToSet)throws RuntimeDaoException;
158    //5.1 GET REFERENCED VALUE
159    /**
160     * Retrieves the {@link ImageBean} object referenced by {@link FaceBean#getImageMd5}() field.<br>
161     * FK_NAME : fd_face_ibfk_1
162     * @param bean the {@link FaceBean}
163     * @return the associated {@link ImageBean} bean or {@code null} if {@code bean} is {@code null}
164     * @throws RuntimeDaoException
165     */
166    public ImageBean getReferencedByImageMd5(FaceBean bean)throws RuntimeDaoException;
167
168    //5.2 SET REFERENCED 
169    /**
170     * Associates the {@link FaceBean} object to the {@link ImageBean} object by {@link FaceBean#getImageMd5}() field.
171     *
172     * @param bean the {@link FaceBean} object to use
173     * @param beanToSet the {@link ImageBean} object to associate to the {@link FaceBean}
174     * @return always beanToSet saved
175     * @throws RuntimeDaoException
176     */
177    public ImageBean setReferencedByImageMd5(FaceBean bean, ImageBean beanToSet)throws RuntimeDaoException;
178    //_____________________________________________________________________
179    //
180    // USING INDICES
181    //_____________________________________________________________________
182
183
184     /**
185     * Retrieves an array of FaceBean using the feature_md5 index.
186     *
187     * @param featureMd5 the feature_md5 column's value filter.
188     * @return an array of FaceBean
189     * @throws RuntimeDaoException
190     */
191    public FaceBean[] loadByIndexFeatureMd5(String featureMd5)throws RuntimeDaoException;
192    
193    /**
194     * Retrieves a list of FaceBean using the feature_md5 index.
195     *
196     * @param featureMd5 the feature_md5 column's value filter.
197     * @return a list of FaceBean
198     * @throws RuntimeDaoException
199     */
200    public java.util.List<FaceBean> loadByIndexFeatureMd5AsList(String featureMd5)throws RuntimeDaoException;
201
202    /**
203     * Deletes rows using the feature_md5 index.
204     *
205     * @param featureMd5 the feature_md5 column's value filter.
206     * @return the number of deleted objects
207     * @throws RuntimeDaoException
208     */
209    public int deleteByIndexFeatureMd5(String featureMd5)throws RuntimeDaoException;
210    
211
212     /**
213     * Retrieves an array of FaceBean using the image_md5 index.
214     *
215     * @param imageMd5 the image_md5 column's value filter.
216     * @return an array of FaceBean
217     * @throws RuntimeDaoException
218     */
219    public FaceBean[] loadByIndexImageMd5(String imageMd5)throws RuntimeDaoException;
220    
221    /**
222     * Retrieves a list of FaceBean using the image_md5 index.
223     *
224     * @param imageMd5 the image_md5 column's value filter.
225     * @return a list of FaceBean
226     * @throws RuntimeDaoException
227     */
228    public java.util.List<FaceBean> loadByIndexImageMd5AsList(String imageMd5)throws RuntimeDaoException;
229
230    /**
231     * Deletes rows using the image_md5 index.
232     *
233     * @param imageMd5 the image_md5 column's value filter.
234     * @return the number of deleted objects
235     * @throws RuntimeDaoException
236     */
237    public int deleteByIndexImageMd5(String imageMd5)throws RuntimeDaoException;
238    
239
240    //45
241    /**
242     * return a primary key list from {@link FaceBean} array
243     * @param beans
244     * @return primary key list
245     */
246    public java.util.List<Integer> toPrimaryKeyList(FaceBean... beans);
247    //46
248    /**
249     * return a primary key list from {@link FaceBean} collection
250     * @param beans
251     * @return primary key list
252     */
253    public java.util.List<Integer> toPrimaryKeyList(java.util.Collection<FaceBean> beans);
254
255}