001// ______________________________________________________
002// Generated by sql2java - https://github.com/10km/sql2java-2-6-7 (custom branch) 
003// modified by guyadong from
004// sql2java original version https://sourceforge.net/projects/sql2java/ 
005// JDBC driver used at code generation time: com.mysql.jdbc.Driver
006// template: manager.interface.java.vm
007// ______________________________________________________
008package net.gdface.facelog.db;
009import net.gdface.facelog.db.exception.ObjectRetrievalException;
010import net.gdface.facelog.db.exception.RuntimeDaoException;
011
012/**
013 * Interface to handle database calls (save, load, count, etc...) for the fl_feature table.<br>
014 * Remarks: 用于验证身份的人脸特征数据表
015 * @author guyadong
016 */
017public interface IFeatureManager extends TableManager<FeatureBean>
018{  
019    //////////////////////////////////////
020    // PRIMARY KEY METHODS
021    //////////////////////////////////////
022
023    //1
024    /**
025     * Loads a {@link FeatureBean} from the fl_feature using primary key fields.
026     *
027     * @param md5 String - PK# 1
028     * @return a unique FeatureBean or {@code null} if not found
029     * @throws RuntimeDaoException
030     */
031    public FeatureBean loadByPrimaryKey(String md5)throws RuntimeDaoException;
032
033    //1.1
034    /**
035     * Loads a {@link FeatureBean} from the fl_feature using primary key fields.
036     *
037     * @param md5 String - PK# 1
038     * @return a unique FeatureBean
039     * @throws ObjectRetrievalException if not found
040     * @throws RuntimeDaoException
041     */
042    public FeatureBean loadByPrimaryKeyChecked(String md5) throws RuntimeDaoException,ObjectRetrievalException;
043    
044    //1.4
045    /**
046     * Returns true if this fl_feature contains row with primary key fields.
047     * @param md5 String - PK# 1
048     * @return
049     * @throws RuntimeDaoException
050     */
051    public boolean existsPrimaryKey(String md5)throws RuntimeDaoException;
052    //1.4.1
053    /**
054     * Check duplicated row by primary keys,if row exists throw exception
055     * @param md5 String
056     * @return 
057     * @throws RuntimeDaoException
058     * @throws ObjectRetrievalException
059     */
060    public String checkDuplicate(String md5)throws RuntimeDaoException,ObjectRetrievalException;
061    //1.8
062    /**
063     * Loads {@link FeatureBean} from the fl_feature using primary key fields.
064     *
065     * @param keys primary keys array
066     * @return list of FeatureBean
067     * @throws RuntimeDaoException
068     */
069    public java.util.List<FeatureBean> loadByPrimaryKey(String... keys)throws RuntimeDaoException;
070    //1.9
071    /**
072     * Loads {@link FeatureBean} from the fl_feature using primary key fields.
073     *
074     * @param keys primary keys collection
075     * @return list of FeatureBean
076     * @throws RuntimeDaoException
077     */
078    public java.util.List<FeatureBean> loadByPrimaryKey(java.util.Collection<String> keys)throws RuntimeDaoException;
079    //2
080    /**
081     * Delete row according to its primary keys.<br>
082     * all keys must not be null
083     *
084     * @param md5 String - PK# 1
085     * @return the number of deleted rows
086     * @throws RuntimeDaoException
087     */
088    public int deleteByPrimaryKey(String md5)throws RuntimeDaoException;
089    //2.2
090    /**
091     * Delete rows according to primary key.<br>
092     *
093     * @param keys primary keys array
094     * @return the number of deleted rows
095     * @throws RuntimeDaoException
096     */
097    public int deleteByPrimaryKey(String... 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     */
106    public int deleteByPrimaryKey(java.util.Collection<String> keys)throws RuntimeDaoException;
107    //2.4
108    /**
109     * Delete beans.<br>
110     *
111     * @param beans FeatureBean collection wille be deleted
112     * @return the number of deleted rows
113     * @throws RuntimeDaoException
114     */
115    public int delete(FeatureBean... beans)throws RuntimeDaoException;
116    //2.5
117    /**
118     * Delete beans.<br>
119     *
120     * @param beans FeatureBean collection wille be deleted
121     * @return the number of deleted rows
122     * @throws RuntimeDaoException
123     */
124    public int delete(java.util.Collection<FeatureBean> beans)throws RuntimeDaoException;
125 
126
127    //////////////////////////////////////
128    // GET/SET IMPORTED KEY BEAN METHOD
129    //////////////////////////////////////
130    //3.1 GET IMPORTED
131    /**
132     * Retrieves the {@link FaceBean} object from the fl_face.feature_md5 field.<BR>
133     * FK_NAME : fl_face_ibfk_2 
134     * @param bean the {@link FeatureBean}
135     * @return the associated {@link FaceBean} beans or {@code null} if {@code bean} is {@code null}
136     * @throws RuntimeDaoException
137     */
138    public FaceBean[] getFaceBeansByFeatureMd5(FeatureBean bean)throws RuntimeDaoException;
139    
140    //3.1.2 GET IMPORTED
141    /**
142     * Retrieves the {@link FaceBean} object from the fl_face.feature_md5 field.<BR>
143     * FK_NAME : fl_face_ibfk_2 
144     * @param md5OfFeature String - PK# 1
145     * @return the associated {@link FaceBean} beans or {@code null} if {@code bean} is {@code null}
146     * @throws RuntimeDaoException
147     */
148    public FaceBean[] getFaceBeansByFeatureMd5(String md5OfFeature)throws RuntimeDaoException;
149    
150    //3.2 GET IMPORTED
151    /**
152     * see also #getFaceBeansByFeatureMd5AsList(FeatureBean,int,int)
153     * @param bean
154     * @return
155     * @throws RuntimeDaoException
156     */
157    public java.util.List<FaceBean> getFaceBeansByFeatureMd5AsList(FeatureBean bean)throws RuntimeDaoException;
158
159    //3.2.2 GET IMPORTED
160    /**
161     * Retrieves the {@link FaceBean} object from fl_face.feature_md5 field.<BR>
162     * FK_NAME:fl_face_ibfk_2
163     * @param md5OfFeature String - PK# 1
164     * @return the associated {@link FaceBean} beans 
165     * @throws RuntimeDaoException
166     */
167    public java.util.List<FaceBean> getFaceBeansByFeatureMd5AsList(String md5OfFeature)throws RuntimeDaoException;
168    //3.2.3 DELETE IMPORTED
169    /**
170     * delete the associated {@link FaceBean} objects from fl_face.feature_md5 field.<BR>
171     * FK_NAME:fl_face_ibfk_2
172     * @param md5OfFeature String - PK# 1
173     * @return the number of deleted rows
174     * @throws RuntimeDaoException
175     */
176    public int deleteFaceBeansByFeatureMd5(String md5OfFeature)throws RuntimeDaoException;
177    //3.2.4 GET IMPORTED
178    /**
179     * Retrieves the {@link FaceBean} object from fl_face.feature_md5 field.<BR>
180     * FK_NAME:fl_face_ibfk_2
181     * @param bean the {@link FeatureBean}
182     * @param startRow the start row to be used (first row = 1, last row=-1)
183     * @param numRows the number of rows to be retrieved (all rows = a negative number)
184     * @return the associated {@link FaceBean} beans or empty list if {@code bean} is {@code null}
185     * @throws RuntimeDaoException
186     */
187    public java.util.List<FaceBean> getFaceBeansByFeatureMd5AsList(FeatureBean bean,int startRow,int numRows)throws RuntimeDaoException;    
188    //3.3 SET IMPORTED
189    /**
190     * set  the {@link FaceBean} object array associate to FeatureBean by the fl_face.feature_md5 field.<BR>
191     * FK_NAME : fl_face_ibfk_2 
192     * @param bean the referenced {@link FeatureBean}
193     * @param importedBeans imported beans from fl_face
194     * @return importedBeans always
195     * @see IFaceManager#setReferencedByFeatureMd5(FaceBean, FeatureBean)
196     * @throws RuntimeDaoException
197     */
198    public FaceBean[] setFaceBeansByFeatureMd5(FeatureBean bean , FaceBean[] importedBeans)throws RuntimeDaoException;
199
200    //3.4 SET IMPORTED
201    /**
202     * set  the {@link FaceBean} object java.util.Collection associate to FeatureBean by the fl_face.feature_md5 field.<BR>
203     * FK_NAME:fl_face_ibfk_2
204     * @param bean the referenced {@link FeatureBean} 
205     * @param importedBeans imported beans from fl_face 
206     * @return importedBeans always
207     * @see IFaceManager#setReferencedByFeatureMd5(FaceBean, FeatureBean)
208     * @throws RuntimeDaoException
209     */
210    public <C extends java.util.Collection<FaceBean>> C setFaceBeansByFeatureMd5(FeatureBean bean , C importedBeans)throws RuntimeDaoException;
211
212    //3.1 GET IMPORTED
213    /**
214     * Retrieves the {@link LogBean} object from the fl_log.verify_feature field.<BR>
215     * FK_NAME : fl_log_ibfk_3 
216     * @param bean the {@link FeatureBean}
217     * @return the associated {@link LogBean} beans or {@code null} if {@code bean} is {@code null}
218     * @throws RuntimeDaoException
219     */
220    public LogBean[] getLogBeansByVerifyFeature(FeatureBean bean)throws RuntimeDaoException;
221    
222    //3.1.2 GET IMPORTED
223    /**
224     * Retrieves the {@link LogBean} object from the fl_log.verify_feature field.<BR>
225     * FK_NAME : fl_log_ibfk_3 
226     * @param md5OfFeature String - PK# 1
227     * @return the associated {@link LogBean} beans or {@code null} if {@code bean} is {@code null}
228     * @throws RuntimeDaoException
229     */
230    public LogBean[] getLogBeansByVerifyFeature(String md5OfFeature)throws RuntimeDaoException;
231    
232    //3.2 GET IMPORTED
233    /**
234     * see also #getLogBeansByVerifyFeatureAsList(FeatureBean,int,int)
235     * @param bean
236     * @return
237     * @throws RuntimeDaoException
238     */
239    public java.util.List<LogBean> getLogBeansByVerifyFeatureAsList(FeatureBean bean)throws RuntimeDaoException;
240
241    //3.2.2 GET IMPORTED
242    /**
243     * Retrieves the {@link LogBean} object from fl_log.verify_feature field.<BR>
244     * FK_NAME:fl_log_ibfk_3
245     * @param md5OfFeature String - PK# 1
246     * @return the associated {@link LogBean} beans 
247     * @throws RuntimeDaoException
248     */
249    public java.util.List<LogBean> getLogBeansByVerifyFeatureAsList(String md5OfFeature)throws RuntimeDaoException;
250    //3.2.3 DELETE IMPORTED
251    /**
252     * delete the associated {@link LogBean} objects from fl_log.verify_feature field.<BR>
253     * FK_NAME:fl_log_ibfk_3
254     * @param md5OfFeature String - PK# 1
255     * @return the number of deleted rows
256     * @throws RuntimeDaoException
257     */
258    public int deleteLogBeansByVerifyFeature(String md5OfFeature)throws RuntimeDaoException;
259    //3.2.4 GET IMPORTED
260    /**
261     * Retrieves the {@link LogBean} object from fl_log.verify_feature field.<BR>
262     * FK_NAME:fl_log_ibfk_3
263     * @param bean the {@link FeatureBean}
264     * @param startRow the start row to be used (first row = 1, last row=-1)
265     * @param numRows the number of rows to be retrieved (all rows = a negative number)
266     * @return the associated {@link LogBean} beans or empty list if {@code bean} is {@code null}
267     * @throws RuntimeDaoException
268     */
269    public java.util.List<LogBean> getLogBeansByVerifyFeatureAsList(FeatureBean bean,int startRow,int numRows)throws RuntimeDaoException;    
270    //3.3 SET IMPORTED
271    /**
272     * set  the {@link LogBean} object array associate to FeatureBean by the fl_log.verify_feature field.<BR>
273     * FK_NAME : fl_log_ibfk_3 
274     * @param bean the referenced {@link FeatureBean}
275     * @param importedBeans imported beans from fl_log
276     * @return importedBeans always
277     * @see ILogManager#setReferencedByVerifyFeature(LogBean, FeatureBean)
278     * @throws RuntimeDaoException
279     */
280    public LogBean[] setLogBeansByVerifyFeature(FeatureBean bean , LogBean[] importedBeans)throws RuntimeDaoException;
281
282    //3.4 SET IMPORTED
283    /**
284     * set  the {@link LogBean} object java.util.Collection associate to FeatureBean by the fl_log.verify_feature field.<BR>
285     * FK_NAME:fl_log_ibfk_3
286     * @param bean the referenced {@link FeatureBean} 
287     * @param importedBeans imported beans from fl_log 
288     * @return importedBeans always
289     * @see ILogManager#setReferencedByVerifyFeature(LogBean, FeatureBean)
290     * @throws RuntimeDaoException
291     */
292    public <C extends java.util.Collection<LogBean>> C setLogBeansByVerifyFeature(FeatureBean bean , C importedBeans)throws RuntimeDaoException;
293
294    //3.5 SYNC SAVE 
295    /**
296     * Save the FeatureBean bean and referenced beans and imported beans into the database.
297     *
298     * @param bean the {@link FeatureBean} bean to be saved
299     * @param refPersonByPersonId the {@link PersonBean} bean referenced by {@link FeatureBean} 
300     * @param impFaceByFeatureMd5 the {@link FaceBean} bean refer to {@link FeatureBean} 
301     * @param impLogByVerifyFeature the {@link LogBean} bean refer to {@link FeatureBean} 
302     * @return the inserted or updated {@link FeatureBean} bean
303     * @throws RuntimeDaoException
304     */
305    public FeatureBean save(FeatureBean bean
306        , PersonBean refPersonByPersonId 
307        , FaceBean[] impFaceByFeatureMd5 , LogBean[] impLogByVerifyFeature )throws RuntimeDaoException;
308    //3.6 SYNC SAVE AS TRANSACTION
309    /**
310     * Transaction version for sync save<br>
311     * see also {@link #save(FeatureBean , PersonBean , FaceBean[] , LogBean[] )}
312     * @param bean the {@link FeatureBean} bean to be saved
313     * @param refPersonByPersonId the {@link PersonBean} bean referenced by {@link FeatureBean} 
314     * @param impFaceByFeatureMd5 the {@link FaceBean} bean refer to {@link FeatureBean} 
315     * @param impLogByVerifyFeature the {@link LogBean} bean refer to {@link FeatureBean} 
316     * @return the inserted or updated {@link FeatureBean} bean
317     * @throws RuntimeDaoException
318     */
319    public FeatureBean saveAsTransaction(final FeatureBean bean
320        ,final PersonBean refPersonByPersonId 
321        ,final FaceBean[] impFaceByFeatureMd5 ,final LogBean[] impLogByVerifyFeature )throws RuntimeDaoException;
322    //3.7 SYNC SAVE 
323    /**
324     * Save the FeatureBean bean and referenced beans and imported beans into the database.
325     *
326     * @param bean the {@link FeatureBean} bean to be saved
327     * @param refPersonByPersonId the {@link PersonBean} bean referenced by {@link FeatureBean} 
328     * @param impFaceByFeatureMd5 the {@link FaceBean} bean refer to {@link FeatureBean} 
329     * @param impLogByVerifyFeature the {@link LogBean} bean refer to {@link FeatureBean} 
330     * @return the inserted or updated {@link FeatureBean} bean
331     * @throws RuntimeDaoException
332     */
333    public FeatureBean save(FeatureBean bean
334        , PersonBean refPersonByPersonId 
335        , java.util.Collection<FaceBean> impFaceByFeatureMd5 , java.util.Collection<LogBean> impLogByVerifyFeature )throws RuntimeDaoException;
336    //3.8 SYNC SAVE AS TRANSACTION
337    /**
338     * Transaction version for sync save<br>
339     * see also {@link #save(FeatureBean , PersonBean , java.util.Collection , java.util.Collection )}
340     * @param bean the {@link FeatureBean} bean to be saved
341     * @param refPersonByPersonId the {@link PersonBean} bean referenced by {@link FeatureBean} 
342     * @param impFaceByFeatureMd5 the {@link FaceBean} bean refer to {@link FeatureBean} 
343     * @param impLogByVerifyFeature the {@link LogBean} bean refer to {@link FeatureBean} 
344     * @return the inserted or updated {@link FeatureBean} bean
345     * @throws RuntimeDaoException
346     */
347    public FeatureBean saveAsTransaction(final FeatureBean bean
348        ,final PersonBean refPersonByPersonId 
349        ,final  java.util.Collection<FaceBean> impFaceByFeatureMd5 ,final  java.util.Collection<LogBean> impLogByVerifyFeature )throws RuntimeDaoException;
350      //////////////////////////////////////
351    // GET/SET FOREIGN KEY BEAN METHOD
352    //////////////////////////////////////
353    //5.1 GET REFERENCED VALUE
354    /**
355     * Retrieves the {@link PersonBean} object referenced by {@link FeatureBean#getPersonId}() field.<br>
356     * FK_NAME : fl_feature_ibfk_1
357     * @param bean the {@link FeatureBean}
358     * @return the associated {@link PersonBean} bean or {@code null} if {@code bean} is {@code null}
359     * @throws RuntimeDaoException
360     */
361    public PersonBean getReferencedByPersonId(FeatureBean bean)throws RuntimeDaoException;
362
363    //5.2 SET REFERENCED 
364    /**
365     * Associates the {@link FeatureBean} object to the {@link PersonBean} object by {@link FeatureBean#getPersonId}() field.
366     *
367     * @param bean the {@link FeatureBean} object to use
368     * @param beanToSet the {@link PersonBean} object to associate to the {@link FeatureBean}
369     * @return always beanToSet saved
370     * @throws RuntimeDaoException
371     */
372    public PersonBean setReferencedByPersonId(FeatureBean bean, PersonBean beanToSet)throws RuntimeDaoException;
373    //_____________________________________________________________________
374    //
375    // USING INDICES
376    //_____________________________________________________________________
377
378
379     /**
380     * Retrieves an array of FeatureBean using the feature_version index.
381     *
382     * @param version the version column's value filter.
383     * @return an array of FeatureBean
384     * @throws RuntimeDaoException
385     */
386    public FeatureBean[] loadByIndexVersion(String version)throws RuntimeDaoException;
387    
388    /**
389     * Retrieves a list of FeatureBean using the feature_version index.
390     *
391     * @param version the version column's value filter.
392     * @return a list of FeatureBean
393     * @throws RuntimeDaoException
394     */
395    public java.util.List<FeatureBean> loadByIndexVersionAsList(String version)throws RuntimeDaoException;
396
397    /**
398     * Deletes rows using the feature_version index.
399     *
400     * @param version the version column's value filter.
401     * @return the number of deleted objects
402     * @throws RuntimeDaoException
403     */
404    public int deleteByIndexVersion(String version)throws RuntimeDaoException;
405    
406
407     /**
408     * Retrieves an array of FeatureBean using the person_id index.
409     *
410     * @param personId the person_id column's value filter.
411     * @return an array of FeatureBean
412     * @throws RuntimeDaoException
413     */
414    public FeatureBean[] loadByIndexPersonId(Integer personId)throws RuntimeDaoException;
415    
416    /**
417     * Retrieves a list of FeatureBean using the person_id index.
418     *
419     * @param personId the person_id column's value filter.
420     * @return a list of FeatureBean
421     * @throws RuntimeDaoException
422     */
423    public java.util.List<FeatureBean> loadByIndexPersonIdAsList(Integer personId)throws RuntimeDaoException;
424
425    /**
426     * Deletes rows using the person_id index.
427     *
428     * @param personId the person_id column's value filter.
429     * @return the number of deleted objects
430     * @throws RuntimeDaoException
431     */
432    public int deleteByIndexPersonId(Integer personId)throws RuntimeDaoException;
433    
434
435    //45
436    /**
437     * return a primary key list from {@link FeatureBean} array
438     * @param beans
439     * @return
440     */
441    public java.util.List<String> toPrimaryKeyList(FeatureBean... beans);
442    //46
443    /**
444     * return a primary key list from {@link FeatureBean} collection
445     * @param beans
446     * @return
447     */
448    public java.util.List<String> toPrimaryKeyList(java.util.Collection<FeatureBean> beans);
449
450}