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_face table.<br> 014 * Remarks: 人脸检测信息数据表,用于保存检测到的人脸的所有信息(特征数据除外) 015 * @author guyadong 016 */ 017public interface IFaceManager extends TableManager<FaceBean> 018{ 019 ////////////////////////////////////// 020 // PRIMARY KEY METHODS 021 ////////////////////////////////////// 022 023 //1 024 /** 025 * Loads a {@link FaceBean} from the fl_face using primary key fields. 026 * 027 * @param id Integer - PK# 1 028 * @return a unique FaceBean or {@code null} if not found 029 * @throws RuntimeDaoException 030 */ 031 public FaceBean loadByPrimaryKey(Integer id)throws RuntimeDaoException; 032 033 //1.1 034 /** 035 * Loads a {@link FaceBean} from the fl_face using primary key fields. 036 * 037 * @param id Integer - PK# 1 038 * @return a unique FaceBean 039 * @throws ObjectRetrievalException if not found 040 * @throws RuntimeDaoException 041 */ 042 public FaceBean loadByPrimaryKeyChecked(Integer id) throws RuntimeDaoException,ObjectRetrievalException; 043 044 //1.4 045 /** 046 * Returns true if this fl_face contains row with primary key fields. 047 * @param id Integer - PK# 1 048 * @return 049 * @throws RuntimeDaoException 050 */ 051 public boolean existsPrimaryKey(Integer id)throws RuntimeDaoException; 052 //1.4.1 053 /** 054 * Check duplicated row by primary keys,if row exists throw exception 055 * @param id Integer 056 * @return 057 * @throws RuntimeDaoException 058 * @throws ObjectRetrievalException 059 */ 060 public Integer checkDuplicate(Integer id)throws RuntimeDaoException,ObjectRetrievalException; 061 //1.8 062 /** 063 * Loads {@link FaceBean} from the fl_face using primary key fields. 064 * 065 * @param keys primary keys array 066 * @return list of FaceBean 067 * @throws RuntimeDaoException 068 */ 069 public java.util.List<FaceBean> loadByPrimaryKey(int... keys)throws RuntimeDaoException; 070 //1.9 071 /** 072 * Loads {@link FaceBean} from the fl_face using primary key fields. 073 * 074 * @param keys primary keys collection 075 * @return list of FaceBean 076 * @throws RuntimeDaoException 077 */ 078 public java.util.List<FaceBean> loadByPrimaryKey(java.util.Collection<Integer> 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 id Integer - PK# 1 085 * @return the number of deleted rows 086 * @throws RuntimeDaoException 087 */ 088 public int deleteByPrimaryKey(Integer id)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(int... 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<Integer> keys)throws RuntimeDaoException; 107 //2.4 108 /** 109 * Delete beans.<br> 110 * 111 * @param beans FaceBean collection wille be deleted 112 * @return the number of deleted rows 113 * @throws RuntimeDaoException 114 */ 115 public int delete(FaceBean... beans)throws RuntimeDaoException; 116 //2.5 117 /** 118 * Delete beans.<br> 119 * 120 * @param beans FaceBean collection wille be deleted 121 * @return the number of deleted rows 122 * @throws RuntimeDaoException 123 */ 124 public int delete(java.util.Collection<FaceBean> beans)throws RuntimeDaoException; 125 126 127 ////////////////////////////////////// 128 // GET/SET IMPORTED KEY BEAN METHOD 129 ////////////////////////////////////// 130 //3.1 GET IMPORTED 131 /** 132 * Retrieves the {@link LogBean} object from the fl_log.compare_face field.<BR> 133 * FK_NAME : fl_log_ibfk_4 134 * @param bean the {@link FaceBean} 135 * @return the associated {@link LogBean} beans or {@code null} if {@code bean} is {@code null} 136 * @throws RuntimeDaoException 137 */ 138 public LogBean[] getLogBeansByCompareFace(FaceBean bean)throws RuntimeDaoException; 139 140 //3.1.2 GET IMPORTED 141 /** 142 * Retrieves the {@link LogBean} object from the fl_log.compare_face field.<BR> 143 * FK_NAME : fl_log_ibfk_4 144 * @param idOfFace Integer - PK# 1 145 * @return the associated {@link LogBean} beans or {@code null} if {@code bean} is {@code null} 146 * @throws RuntimeDaoException 147 */ 148 public LogBean[] getLogBeansByCompareFace(Integer idOfFace)throws RuntimeDaoException; 149 150 //3.2 GET IMPORTED 151 /** 152 * see also #getLogBeansByCompareFaceAsList(FaceBean,int,int) 153 * @param bean 154 * @return 155 * @throws RuntimeDaoException 156 */ 157 public java.util.List<LogBean> getLogBeansByCompareFaceAsList(FaceBean bean)throws RuntimeDaoException; 158 159 //3.2.2 GET IMPORTED 160 /** 161 * Retrieves the {@link LogBean} object from fl_log.compare_face field.<BR> 162 * FK_NAME:fl_log_ibfk_4 163 * @param idOfFace Integer - PK# 1 164 * @return the associated {@link LogBean} beans 165 * @throws RuntimeDaoException 166 */ 167 public java.util.List<LogBean> getLogBeansByCompareFaceAsList(Integer idOfFace)throws RuntimeDaoException; 168 //3.2.3 DELETE IMPORTED 169 /** 170 * delete the associated {@link LogBean} objects from fl_log.compare_face field.<BR> 171 * FK_NAME:fl_log_ibfk_4 172 * @param idOfFace Integer - PK# 1 173 * @return the number of deleted rows 174 * @throws RuntimeDaoException 175 */ 176 public int deleteLogBeansByCompareFace(Integer idOfFace)throws RuntimeDaoException; 177 //3.2.4 GET IMPORTED 178 /** 179 * Retrieves the {@link LogBean} object from fl_log.compare_face field.<BR> 180 * FK_NAME:fl_log_ibfk_4 181 * @param bean the {@link FaceBean} 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 LogBean} beans or empty list if {@code bean} is {@code null} 185 * @throws RuntimeDaoException 186 */ 187 public java.util.List<LogBean> getLogBeansByCompareFaceAsList(FaceBean bean,int startRow,int numRows)throws RuntimeDaoException; 188 //3.3 SET IMPORTED 189 /** 190 * set the {@link LogBean} object array associate to FaceBean by the fl_log.compare_face field.<BR> 191 * FK_NAME : fl_log_ibfk_4 192 * @param bean the referenced {@link FaceBean} 193 * @param importedBeans imported beans from fl_log 194 * @return importedBeans always 195 * @see ILogManager#setReferencedByCompareFace(LogBean, FaceBean) 196 * @throws RuntimeDaoException 197 */ 198 public LogBean[] setLogBeansByCompareFace(FaceBean bean , LogBean[] importedBeans)throws RuntimeDaoException; 199 200 //3.4 SET IMPORTED 201 /** 202 * set the {@link LogBean} object java.util.Collection associate to FaceBean by the fl_log.compare_face field.<BR> 203 * FK_NAME:fl_log_ibfk_4 204 * @param bean the referenced {@link FaceBean} 205 * @param importedBeans imported beans from fl_log 206 * @return importedBeans always 207 * @see ILogManager#setReferencedByCompareFace(LogBean, FaceBean) 208 * @throws RuntimeDaoException 209 */ 210 public <C extends java.util.Collection<LogBean>> C setLogBeansByCompareFace(FaceBean bean , C importedBeans)throws RuntimeDaoException; 211 212 //3.5 SYNC SAVE 213 /** 214 * Save the FaceBean bean and referenced beans and imported beans into the database. 215 * 216 * @param bean the {@link FaceBean} bean to be saved 217 * @param refFeatureByFeatureMd5 the {@link FeatureBean} bean referenced by {@link FaceBean} 218 * @param refImageByImageMd5 the {@link ImageBean} bean referenced by {@link FaceBean} 219 * @param impLogByCompareFace the {@link LogBean} bean refer to {@link FaceBean} 220 * @return the inserted or updated {@link FaceBean} bean 221 * @throws RuntimeDaoException 222 */ 223 public FaceBean save(FaceBean bean 224 , FeatureBean refFeatureByFeatureMd5 , ImageBean refImageByImageMd5 225 , LogBean[] impLogByCompareFace )throws RuntimeDaoException; 226 //3.6 SYNC SAVE AS TRANSACTION 227 /** 228 * Transaction version for sync save<br> 229 * see also {@link #save(FaceBean , FeatureBean , ImageBean , LogBean[] )} 230 * @param bean the {@link FaceBean} bean to be saved 231 * @param refFeatureByFeatureMd5 the {@link FeatureBean} bean referenced by {@link FaceBean} 232 * @param refImageByImageMd5 the {@link ImageBean} bean referenced by {@link FaceBean} 233 * @param impLogByCompareFace the {@link LogBean} bean refer to {@link FaceBean} 234 * @return the inserted or updated {@link FaceBean} bean 235 * @throws RuntimeDaoException 236 */ 237 public FaceBean saveAsTransaction(final FaceBean bean 238 ,final FeatureBean refFeatureByFeatureMd5 ,final ImageBean refImageByImageMd5 239 ,final LogBean[] impLogByCompareFace )throws RuntimeDaoException; 240 //3.7 SYNC SAVE 241 /** 242 * Save the FaceBean bean and referenced beans and imported beans into the database. 243 * 244 * @param bean the {@link FaceBean} bean to be saved 245 * @param refFeatureByFeatureMd5 the {@link FeatureBean} bean referenced by {@link FaceBean} 246 * @param refImageByImageMd5 the {@link ImageBean} bean referenced by {@link FaceBean} 247 * @param impLogByCompareFace the {@link LogBean} bean refer to {@link FaceBean} 248 * @return the inserted or updated {@link FaceBean} bean 249 * @throws RuntimeDaoException 250 */ 251 public FaceBean save(FaceBean bean 252 , FeatureBean refFeatureByFeatureMd5 , ImageBean refImageByImageMd5 253 , java.util.Collection<LogBean> impLogByCompareFace )throws RuntimeDaoException; 254 //3.8 SYNC SAVE AS TRANSACTION 255 /** 256 * Transaction version for sync save<br> 257 * see also {@link #save(FaceBean , FeatureBean , ImageBean , java.util.Collection )} 258 * @param bean the {@link FaceBean} bean to be saved 259 * @param refFeatureByFeatureMd5 the {@link FeatureBean} bean referenced by {@link FaceBean} 260 * @param refImageByImageMd5 the {@link ImageBean} bean referenced by {@link FaceBean} 261 * @param impLogByCompareFace the {@link LogBean} bean refer to {@link FaceBean} 262 * @return the inserted or updated {@link FaceBean} bean 263 * @throws RuntimeDaoException 264 */ 265 public FaceBean saveAsTransaction(final FaceBean bean 266 ,final FeatureBean refFeatureByFeatureMd5 ,final ImageBean refImageByImageMd5 267 ,final java.util.Collection<LogBean> impLogByCompareFace )throws RuntimeDaoException; 268 ////////////////////////////////////// 269 // GET/SET FOREIGN KEY BEAN METHOD 270 ////////////////////////////////////// 271 //5.1 GET REFERENCED VALUE 272 /** 273 * Retrieves the {@link FeatureBean} object referenced by {@link FaceBean#getFeatureMd5}() field.<br> 274 * FK_NAME : fl_face_ibfk_2 275 * @param bean the {@link FaceBean} 276 * @return the associated {@link FeatureBean} bean or {@code null} if {@code bean} is {@code null} 277 * @throws RuntimeDaoException 278 */ 279 public FeatureBean getReferencedByFeatureMd5(FaceBean bean)throws RuntimeDaoException; 280 281 //5.2 SET REFERENCED 282 /** 283 * Associates the {@link FaceBean} object to the {@link FeatureBean} object by {@link FaceBean#getFeatureMd5}() field. 284 * 285 * @param bean the {@link FaceBean} object to use 286 * @param beanToSet the {@link FeatureBean} object to associate to the {@link FaceBean} 287 * @return always beanToSet saved 288 * @throws RuntimeDaoException 289 */ 290 public FeatureBean setReferencedByFeatureMd5(FaceBean bean, FeatureBean beanToSet)throws RuntimeDaoException; 291 //5.1 GET REFERENCED VALUE 292 /** 293 * Retrieves the {@link ImageBean} object referenced by {@link FaceBean#getImageMd5}() field.<br> 294 * FK_NAME : fl_face_ibfk_1 295 * @param bean the {@link FaceBean} 296 * @return the associated {@link ImageBean} bean or {@code null} if {@code bean} is {@code null} 297 * @throws RuntimeDaoException 298 */ 299 public ImageBean getReferencedByImageMd5(FaceBean bean)throws RuntimeDaoException; 300 301 //5.2 SET REFERENCED 302 /** 303 * Associates the {@link FaceBean} object to the {@link ImageBean} object by {@link FaceBean#getImageMd5}() field. 304 * 305 * @param bean the {@link FaceBean} object to use 306 * @param beanToSet the {@link ImageBean} object to associate to the {@link FaceBean} 307 * @return always beanToSet saved 308 * @throws RuntimeDaoException 309 */ 310 public ImageBean setReferencedByImageMd5(FaceBean bean, ImageBean beanToSet)throws RuntimeDaoException; 311 //_____________________________________________________________________ 312 // 313 // USING INDICES 314 //_____________________________________________________________________ 315 316 317 /** 318 * Retrieves an array of FaceBean using the feature_md5 index. 319 * 320 * @param featureMd5 the feature_md5 column's value filter. 321 * @return an array of FaceBean 322 * @throws RuntimeDaoException 323 */ 324 public FaceBean[] loadByIndexFeatureMd5(String featureMd5)throws RuntimeDaoException; 325 326 /** 327 * Retrieves a list of FaceBean using the feature_md5 index. 328 * 329 * @param featureMd5 the feature_md5 column's value filter. 330 * @return a list of FaceBean 331 * @throws RuntimeDaoException 332 */ 333 public java.util.List<FaceBean> loadByIndexFeatureMd5AsList(String featureMd5)throws RuntimeDaoException; 334 335 /** 336 * Deletes rows using the feature_md5 index. 337 * 338 * @param featureMd5 the feature_md5 column's value filter. 339 * @return the number of deleted objects 340 * @throws RuntimeDaoException 341 */ 342 public int deleteByIndexFeatureMd5(String featureMd5)throws RuntimeDaoException; 343 344 345 /** 346 * Retrieves an array of FaceBean using the image_md5 index. 347 * 348 * @param imageMd5 the image_md5 column's value filter. 349 * @return an array of FaceBean 350 * @throws RuntimeDaoException 351 */ 352 public FaceBean[] loadByIndexImageMd5(String imageMd5)throws RuntimeDaoException; 353 354 /** 355 * Retrieves a list of FaceBean using the image_md5 index. 356 * 357 * @param imageMd5 the image_md5 column's value filter. 358 * @return a list of FaceBean 359 * @throws RuntimeDaoException 360 */ 361 public java.util.List<FaceBean> loadByIndexImageMd5AsList(String imageMd5)throws RuntimeDaoException; 362 363 /** 364 * Deletes rows using the image_md5 index. 365 * 366 * @param imageMd5 the image_md5 column's value filter. 367 * @return the number of deleted objects 368 * @throws RuntimeDaoException 369 */ 370 public int deleteByIndexImageMd5(String imageMd5)throws RuntimeDaoException; 371 372 373 //45 374 /** 375 * return a primary key list from {@link FaceBean} array 376 * @param beans 377 * @return 378 */ 379 public java.util.List<Integer> toPrimaryKeyList(FaceBean... beans); 380 //46 381 /** 382 * return a primary key list from {@link FaceBean} collection 383 * @param beans 384 * @return 385 */ 386 public java.util.List<Integer> toPrimaryKeyList(java.util.Collection<FaceBean> beans); 387 388}