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_feature table.<br>
013 * Remarks: 用于验证身份的人脸特征数据表
014 * @author guyadong
015 */
016public interface IFeatureManager extends TableManager<FeatureBean>
017{  
018    //////////////////////////////////////
019    // PRIMARY KEY METHODS
020    //////////////////////////////////////
021
022    //1
023    /**
024     * Loads a {@link FeatureBean} from the fd_feature using primary key fields.
025     *
026     * @param md5 String - PK# 1
027     * @return a unique FeatureBean or {@code null} if not found
028     * @throws RuntimeDaoException
029     */
030    public FeatureBean loadByPrimaryKey(String md5)throws RuntimeDaoException;
031
032    //1.1
033    /**
034     * Loads a {@link FeatureBean} from the fd_feature using primary key fields.
035     *
036     * @param md5 String - PK# 1
037     * @return a unique FeatureBean
038     * @throws ObjectRetrievalException if not found
039     * @throws RuntimeDaoException
040     */
041    public FeatureBean loadByPrimaryKeyChecked(String md5) throws RuntimeDaoException,ObjectRetrievalException;
042    
043    //1.4
044    /**
045     * check if contains row with primary key fields.
046     * @param md5 String - PK# 1
047     * @return true if this fd_feature contains row with primary key fields.
048     * @throws RuntimeDaoException
049     */
050    public boolean existsPrimaryKey(String md5)throws RuntimeDaoException;
051    //1.4.1
052    /**
053     * Check duplicated row by primary keys,if row exists throw exception
054     * @param md5 primary keys
055     * @return md5
056     * @throws RuntimeDaoException
057     * @throws ObjectRetrievalException
058     */
059    public String checkDuplicate(String md5)throws RuntimeDaoException,ObjectRetrievalException;
060    //1.8
061    /**
062     * Loads {@link FeatureBean} from the fd_feature using primary key fields.
063     *
064     * @param keys primary keys array
065     * @return list of FeatureBean
066     * @throws RuntimeDaoException
067     */
068    public java.util.List<FeatureBean> loadByPrimaryKey(String... keys)throws RuntimeDaoException;
069    //1.9
070    /**
071     * Loads {@link FeatureBean} from the fd_feature using primary key fields.
072     *
073     * @param keys primary keys collection
074     * @return list of FeatureBean
075     * @throws RuntimeDaoException
076     */
077    public java.util.List<FeatureBean> loadByPrimaryKey(java.util.Collection<String> 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 md5 String - PK# 1
084     * @return the number of deleted rows
085     * @throws RuntimeDaoException
086     */
087    public int deleteByPrimaryKey(String md5)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(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     * @see #delete(gu.sql2java.BaseBean)
106     */
107    public int deleteByPrimaryKey(java.util.Collection<String> keys)throws RuntimeDaoException;
108 
109
110    //////////////////////////////////////
111    // GET/SET IMPORTED KEY BEAN METHOD
112    //////////////////////////////////////
113    //3.1 GET IMPORTED
114    /**
115     * Retrieves the {@link FaceBean} object from the fd_face.feature_md5 field.<BR>
116     * FK_NAME : fd_face_ibfk_2 
117     * @param bean the {@link FeatureBean}
118     * @return the associated {@link FaceBean} beans or {@code null} if {@code bean} is {@code null}
119     * @throws RuntimeDaoException
120     */
121    public FaceBean[] getFaceBeansByFeatureMd5(FeatureBean bean)throws RuntimeDaoException;
122    
123    //3.1.2 GET IMPORTED
124    /**
125     * Retrieves the {@link FaceBean} object from the fd_face.feature_md5 field.<BR>
126     * FK_NAME : fd_face_ibfk_2 
127     * @param md5OfFeature String - PK# 1
128     * @return the associated {@link FaceBean} beans or {@code null} if {@code bean} is {@code null}
129     * @throws RuntimeDaoException
130     */
131    public FaceBean[] getFaceBeansByFeatureMd5(String md5OfFeature)throws RuntimeDaoException;
132    
133    //3.2 GET IMPORTED
134    /**
135     * see also #getFaceBeansByFeatureMd5AsList(FeatureBean,int,int)
136     * @param bean
137     * @return import bean list
138     * @throws RuntimeDaoException
139     */
140    public java.util.List<FaceBean> getFaceBeansByFeatureMd5AsList(FeatureBean bean)throws RuntimeDaoException;
141
142    //3.2.2 GET IMPORTED
143    /**
144     * Retrieves the {@link FaceBean} object from fd_face.feature_md5 field.<BR>
145     * FK_NAME:fd_face_ibfk_2
146     * @param md5OfFeature String - PK# 1
147     * @return the associated {@link FaceBean} beans 
148     * @throws RuntimeDaoException
149     */
150    public java.util.List<FaceBean> getFaceBeansByFeatureMd5AsList(String md5OfFeature)throws RuntimeDaoException;
151    //3.2.3 DELETE IMPORTED
152    /**
153     * delete the associated {@link FaceBean} objects from fd_face.feature_md5 field.<BR>
154     * FK_NAME:fd_face_ibfk_2
155     * @param md5OfFeature String - PK# 1
156     * @return the number of deleted rows
157     * @throws RuntimeDaoException
158     */
159    public int deleteFaceBeansByFeatureMd5(String md5OfFeature)throws RuntimeDaoException;
160    //3.2.4 GET IMPORTED
161    /**
162     * Retrieves the {@link FaceBean} object from fd_face.feature_md5 field.<BR>
163     * FK_NAME:fd_face_ibfk_2
164     * @param bean the {@link FeatureBean}
165     * @param startRow the start row to be used (first row = 1, last row=-1)
166     * @param numRows the number of rows to be retrieved (all rows = a negative number)
167     * @return the associated {@link FaceBean} beans or empty list if {@code bean} is {@code null}
168     * @throws RuntimeDaoException
169     */
170    public java.util.List<FaceBean> getFaceBeansByFeatureMd5AsList(FeatureBean bean,int startRow,int numRows)throws RuntimeDaoException;    
171    //3.3 SET IMPORTED
172    /**
173     * set  the {@link FaceBean} object array associate to FeatureBean by the fd_face.feature_md5 field.<BR>
174     * FK_NAME : fd_face_ibfk_2 
175     * @param bean the referenced {@link FeatureBean}
176     * @param importedBeans imported beans from fd_face
177     * @return importedBeans always
178     * @see IFaceManager#setReferencedByFeatureMd5(FaceBean, FeatureBean)
179     * @throws RuntimeDaoException
180     */
181    public FaceBean[] setFaceBeansByFeatureMd5(FeatureBean bean , FaceBean[] importedBeans)throws RuntimeDaoException;
182
183    //3.4 SET IMPORTED
184    /**
185     * set  the {@link FaceBean} object java.util.Collection associate to FeatureBean by the fd_face.feature_md5 field.<BR>
186     * FK_NAME:fd_face_ibfk_2
187     * @param bean the referenced {@link FeatureBean} 
188     * @param importedBeans imported beans from fd_face 
189     * @return importedBeans always
190     * @see IFaceManager#setReferencedByFeatureMd5(FaceBean, FeatureBean)
191     * @throws RuntimeDaoException
192     */
193    public <C extends java.util.Collection<FaceBean>> C setFaceBeansByFeatureMd5(FeatureBean bean , C importedBeans)throws RuntimeDaoException;
194
195    //3.5 SYNC SAVE 
196    /**
197     * Save the FeatureBean bean and referenced beans and imported beans into the database.
198     *
199     * @param bean the {@link FeatureBean} bean to be saved
200         * @param impFaceByFeatureMd5 the {@link FaceBean} bean refer to {@link FeatureBean} 
201     * @return the inserted or updated {@link FeatureBean} bean
202     * @throws RuntimeDaoException
203     */
204    public FeatureBean save(FeatureBean bean
205        
206        , FaceBean[] impFaceByFeatureMd5 )throws RuntimeDaoException;
207    //3.6 SYNC SAVE AS TRANSACTION
208    /**
209     * Transaction version for sync save<br>
210     * see also {@link #save(FeatureBean , FaceBean[] )}
211     * @param bean the {@link FeatureBean} bean to be saved
212         * @param impFaceByFeatureMd5 the {@link FaceBean} bean refer to {@link FeatureBean} 
213     * @return the inserted or updated {@link FeatureBean} bean
214     * @throws RuntimeDaoException
215     */
216    public FeatureBean saveAsTransaction(final FeatureBean bean
217        
218        ,final FaceBean[] impFaceByFeatureMd5 )throws RuntimeDaoException;
219    //3.7 SYNC SAVE 
220    /**
221     * Save the FeatureBean bean and referenced beans and imported beans into the database.
222     *
223     * @param bean the {@link FeatureBean} bean to be saved
224         * @param impFaceByFeatureMd5 the {@link FaceBean} bean refer to {@link FeatureBean} 
225     * @return the inserted or updated {@link FeatureBean} bean
226     * @throws RuntimeDaoException
227     */
228    public FeatureBean save(FeatureBean bean
229        
230        , java.util.Collection<FaceBean> impFaceByFeatureMd5 )throws RuntimeDaoException;
231    //3.8 SYNC SAVE AS TRANSACTION
232    /**
233     * Transaction version for sync save<br>
234     * see also {@link #save(FeatureBean , java.util.Collection )}
235     * @param bean the {@link FeatureBean} bean to be saved
236         * @param impFaceByFeatureMd5 the {@link FaceBean} bean refer to {@link FeatureBean} 
237     * @return the inserted or updated {@link FeatureBean} bean
238     * @throws RuntimeDaoException
239     */
240    public FeatureBean saveAsTransaction(final FeatureBean bean
241        
242        ,final  java.util.Collection<FaceBean> impFaceByFeatureMd5 )throws RuntimeDaoException;
243  
244    //45
245    /**
246     * return a primary key list from {@link FeatureBean} array
247     * @param beans
248     * @return primary key list
249     */
250    public java.util.List<String> toPrimaryKeyList(FeatureBean... beans);
251    //46
252    /**
253     * return a primary key list from {@link FeatureBean} collection
254     * @param beans
255     * @return primary key list
256     */
257    public java.util.List<String> toPrimaryKeyList(java.util.Collection<FeatureBean> beans);
258
259}