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_log table.<br> 014 * Remarks: 人脸验证日志,记录所有通过验证的人员 015 * @author guyadong 016 */ 017public interface ILogManager extends TableManager<LogBean> 018{ 019 ////////////////////////////////////// 020 // PRIMARY KEY METHODS 021 ////////////////////////////////////// 022 023 //1 024 /** 025 * Loads a {@link LogBean} from the fl_log using primary key fields. 026 * 027 * @param id Integer - PK# 1 028 * @return a unique LogBean or {@code null} if not found 029 * @throws RuntimeDaoException 030 */ 031 public LogBean loadByPrimaryKey(Integer id)throws RuntimeDaoException; 032 033 //1.1 034 /** 035 * Loads a {@link LogBean} from the fl_log using primary key fields. 036 * 037 * @param id Integer - PK# 1 038 * @return a unique LogBean 039 * @throws ObjectRetrievalException if not found 040 * @throws RuntimeDaoException 041 */ 042 public LogBean loadByPrimaryKeyChecked(Integer id) throws RuntimeDaoException,ObjectRetrievalException; 043 044 //1.4 045 /** 046 * Returns true if this fl_log 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 LogBean} from the fl_log using primary key fields. 064 * 065 * @param keys primary keys array 066 * @return list of LogBean 067 * @throws RuntimeDaoException 068 */ 069 public java.util.List<LogBean> loadByPrimaryKey(int... keys)throws RuntimeDaoException; 070 //1.9 071 /** 072 * Loads {@link LogBean} from the fl_log using primary key fields. 073 * 074 * @param keys primary keys collection 075 * @return list of LogBean 076 * @throws RuntimeDaoException 077 */ 078 public java.util.List<LogBean> 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 LogBean collection wille be deleted 112 * @return the number of deleted rows 113 * @throws RuntimeDaoException 114 */ 115 public int delete(LogBean... beans)throws RuntimeDaoException; 116 //2.5 117 /** 118 * Delete beans.<br> 119 * 120 * @param beans LogBean collection wille be deleted 121 * @return the number of deleted rows 122 * @throws RuntimeDaoException 123 */ 124 public int delete(java.util.Collection<LogBean> beans)throws RuntimeDaoException; 125 126 //3.5 SYNC SAVE 127 /** 128 * Save the LogBean bean and referenced beans and imported beans into the database. 129 * 130 * @param bean the {@link LogBean} bean to be saved 131 * @param refDeviceByDeviceId the {@link DeviceBean} bean referenced by {@link LogBean} 132 * @param refFaceByCompareFace the {@link FaceBean} bean referenced by {@link LogBean} 133 * @param refFeatureByVerifyFeature the {@link FeatureBean} bean referenced by {@link LogBean} 134 * @param refPersonByPersonId the {@link PersonBean} bean referenced by {@link LogBean} 135 * @return the inserted or updated {@link LogBean} bean 136 * @throws RuntimeDaoException 137 */ 138 public LogBean save(LogBean bean 139 , DeviceBean refDeviceByDeviceId , FaceBean refFaceByCompareFace , FeatureBean refFeatureByVerifyFeature , PersonBean refPersonByPersonId 140 )throws RuntimeDaoException; 141 //3.6 SYNC SAVE AS TRANSACTION 142 /** 143 * Transaction version for sync save<br> 144 * see also {@link #save(LogBean , DeviceBean , FaceBean , FeatureBean , PersonBean )} 145 * @param bean the {@link LogBean} bean to be saved 146 * @param refDeviceByDeviceId the {@link DeviceBean} bean referenced by {@link LogBean} 147 * @param refFaceByCompareFace the {@link FaceBean} bean referenced by {@link LogBean} 148 * @param refFeatureByVerifyFeature the {@link FeatureBean} bean referenced by {@link LogBean} 149 * @param refPersonByPersonId the {@link PersonBean} bean referenced by {@link LogBean} 150 * @return the inserted or updated {@link LogBean} bean 151 * @throws RuntimeDaoException 152 */ 153 public LogBean saveAsTransaction(final LogBean bean 154 ,final DeviceBean refDeviceByDeviceId ,final FaceBean refFaceByCompareFace ,final FeatureBean refFeatureByVerifyFeature ,final PersonBean refPersonByPersonId 155 )throws RuntimeDaoException; 156 ////////////////////////////////////// 157 // GET/SET FOREIGN KEY BEAN METHOD 158 ////////////////////////////////////// 159 //5.1 GET REFERENCED VALUE 160 /** 161 * Retrieves the {@link DeviceBean} object referenced by {@link LogBean#getDeviceId}() field.<br> 162 * FK_NAME : fl_log_ibfk_2 163 * @param bean the {@link LogBean} 164 * @return the associated {@link DeviceBean} bean or {@code null} if {@code bean} is {@code null} 165 * @throws RuntimeDaoException 166 */ 167 public DeviceBean getReferencedByDeviceId(LogBean bean)throws RuntimeDaoException; 168 169 //5.2 SET REFERENCED 170 /** 171 * Associates the {@link LogBean} object to the {@link DeviceBean} object by {@link LogBean#getDeviceId}() field. 172 * 173 * @param bean the {@link LogBean} object to use 174 * @param beanToSet the {@link DeviceBean} object to associate to the {@link LogBean} 175 * @return always beanToSet saved 176 * @throws RuntimeDaoException 177 */ 178 public DeviceBean setReferencedByDeviceId(LogBean bean, DeviceBean beanToSet)throws RuntimeDaoException; 179 //5.1 GET REFERENCED VALUE 180 /** 181 * Retrieves the {@link FaceBean} object referenced by {@link LogBean#getCompareFace}() field.<br> 182 * FK_NAME : fl_log_ibfk_4 183 * @param bean the {@link LogBean} 184 * @return the associated {@link FaceBean} bean or {@code null} if {@code bean} is {@code null} 185 * @throws RuntimeDaoException 186 */ 187 public FaceBean getReferencedByCompareFace(LogBean bean)throws RuntimeDaoException; 188 189 //5.2 SET REFERENCED 190 /** 191 * Associates the {@link LogBean} object to the {@link FaceBean} object by {@link LogBean#getCompareFace}() field. 192 * 193 * @param bean the {@link LogBean} object to use 194 * @param beanToSet the {@link FaceBean} object to associate to the {@link LogBean} 195 * @return always beanToSet saved 196 * @throws RuntimeDaoException 197 */ 198 public FaceBean setReferencedByCompareFace(LogBean bean, FaceBean beanToSet)throws RuntimeDaoException; 199 //5.1 GET REFERENCED VALUE 200 /** 201 * Retrieves the {@link FeatureBean} object referenced by {@link LogBean#getVerifyFeature}() field.<br> 202 * FK_NAME : fl_log_ibfk_3 203 * @param bean the {@link LogBean} 204 * @return the associated {@link FeatureBean} bean or {@code null} if {@code bean} is {@code null} 205 * @throws RuntimeDaoException 206 */ 207 public FeatureBean getReferencedByVerifyFeature(LogBean bean)throws RuntimeDaoException; 208 209 //5.2 SET REFERENCED 210 /** 211 * Associates the {@link LogBean} object to the {@link FeatureBean} object by {@link LogBean#getVerifyFeature}() field. 212 * 213 * @param bean the {@link LogBean} object to use 214 * @param beanToSet the {@link FeatureBean} object to associate to the {@link LogBean} 215 * @return always beanToSet saved 216 * @throws RuntimeDaoException 217 */ 218 public FeatureBean setReferencedByVerifyFeature(LogBean bean, FeatureBean beanToSet)throws RuntimeDaoException; 219 //5.1 GET REFERENCED VALUE 220 /** 221 * Retrieves the {@link PersonBean} object referenced by {@link LogBean#getPersonId}() field.<br> 222 * FK_NAME : fl_log_ibfk_1 223 * @param bean the {@link LogBean} 224 * @return the associated {@link PersonBean} bean or {@code null} if {@code bean} is {@code null} 225 * @throws RuntimeDaoException 226 */ 227 public PersonBean getReferencedByPersonId(LogBean bean)throws RuntimeDaoException; 228 229 //5.2 SET REFERENCED 230 /** 231 * Associates the {@link LogBean} object to the {@link PersonBean} object by {@link LogBean#getPersonId}() field. 232 * 233 * @param bean the {@link LogBean} object to use 234 * @param beanToSet the {@link PersonBean} object to associate to the {@link LogBean} 235 * @return always beanToSet saved 236 * @throws RuntimeDaoException 237 */ 238 public PersonBean setReferencedByPersonId(LogBean bean, PersonBean beanToSet)throws RuntimeDaoException; 239 //_____________________________________________________________________ 240 // 241 // USING INDICES 242 //_____________________________________________________________________ 243 244 245 /** 246 * Retrieves an array of LogBean using the compare_face index. 247 * 248 * @param compareFace the compare_face column's value filter. 249 * @return an array of LogBean 250 * @throws RuntimeDaoException 251 */ 252 public LogBean[] loadByIndexCompareFace(Integer compareFace)throws RuntimeDaoException; 253 254 /** 255 * Retrieves a list of LogBean using the compare_face index. 256 * 257 * @param compareFace the compare_face column's value filter. 258 * @return a list of LogBean 259 * @throws RuntimeDaoException 260 */ 261 public java.util.List<LogBean> loadByIndexCompareFaceAsList(Integer compareFace)throws RuntimeDaoException; 262 263 /** 264 * Deletes rows using the compare_face index. 265 * 266 * @param compareFace the compare_face column's value filter. 267 * @return the number of deleted objects 268 * @throws RuntimeDaoException 269 */ 270 public int deleteByIndexCompareFace(Integer compareFace)throws RuntimeDaoException; 271 272 273 /** 274 * Retrieves an array of LogBean using the device_id index. 275 * 276 * @param deviceId the device_id column's value filter. 277 * @return an array of LogBean 278 * @throws RuntimeDaoException 279 */ 280 public LogBean[] loadByIndexDeviceId(Integer deviceId)throws RuntimeDaoException; 281 282 /** 283 * Retrieves a list of LogBean using the device_id index. 284 * 285 * @param deviceId the device_id column's value filter. 286 * @return a list of LogBean 287 * @throws RuntimeDaoException 288 */ 289 public java.util.List<LogBean> loadByIndexDeviceIdAsList(Integer deviceId)throws RuntimeDaoException; 290 291 /** 292 * Deletes rows using the device_id index. 293 * 294 * @param deviceId the device_id column's value filter. 295 * @return the number of deleted objects 296 * @throws RuntimeDaoException 297 */ 298 public int deleteByIndexDeviceId(Integer deviceId)throws RuntimeDaoException; 299 300 301 /** 302 * Retrieves an array of LogBean using the person_id index. 303 * 304 * @param personId the person_id column's value filter. 305 * @return an array of LogBean 306 * @throws RuntimeDaoException 307 */ 308 public LogBean[] loadByIndexPersonId(Integer personId)throws RuntimeDaoException; 309 310 /** 311 * Retrieves a list of LogBean using the person_id index. 312 * 313 * @param personId the person_id column's value filter. 314 * @return a list of LogBean 315 * @throws RuntimeDaoException 316 */ 317 public java.util.List<LogBean> loadByIndexPersonIdAsList(Integer personId)throws RuntimeDaoException; 318 319 /** 320 * Deletes rows using the person_id index. 321 * 322 * @param personId the person_id column's value filter. 323 * @return the number of deleted objects 324 * @throws RuntimeDaoException 325 */ 326 public int deleteByIndexPersonId(Integer personId)throws RuntimeDaoException; 327 328 329 /** 330 * Retrieves an array of LogBean using the verify_feature index. 331 * 332 * @param verifyFeature the verify_feature column's value filter. 333 * @return an array of LogBean 334 * @throws RuntimeDaoException 335 */ 336 public LogBean[] loadByIndexVerifyFeature(String verifyFeature)throws RuntimeDaoException; 337 338 /** 339 * Retrieves a list of LogBean using the verify_feature index. 340 * 341 * @param verifyFeature the verify_feature column's value filter. 342 * @return a list of LogBean 343 * @throws RuntimeDaoException 344 */ 345 public java.util.List<LogBean> loadByIndexVerifyFeatureAsList(String verifyFeature)throws RuntimeDaoException; 346 347 /** 348 * Deletes rows using the verify_feature index. 349 * 350 * @param verifyFeature the verify_feature column's value filter. 351 * @return the number of deleted objects 352 * @throws RuntimeDaoException 353 */ 354 public int deleteByIndexVerifyFeature(String verifyFeature)throws RuntimeDaoException; 355 356 357 //45 358 /** 359 * return a primary key list from {@link LogBean} array 360 * @param beans 361 * @return 362 */ 363 public java.util.List<Integer> toPrimaryKeyList(LogBean... beans); 364 //46 365 /** 366 * return a primary key list from {@link LogBean} collection 367 * @param beans 368 * @return 369 */ 370 public java.util.List<Integer> toPrimaryKeyList(java.util.Collection<LogBean> beans); 371 372}