-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBaseEtt.h
More file actions
96 lines (83 loc) · 1.62 KB
/
BaseEtt.h
File metadata and controls
96 lines (83 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//
// HSDBaseEtt.h
// HaoShiDai
//
// Created by 沈佳 on 14-12-15.
// Copyright (c) 2014年 shenjia. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
#import "NSObject+BindProperty.h"
#import "AppDelegate.h"
#import "PageInfo.h"
/**
* 实体基类
*/
@interface BaseEtt : NSManagedObject
//获取类名
+(NSString*)className;
//创建一个新的实体
+(HSDBaseEtt*) createEntity;
//根据where条件查询实体
+(NSArray*) selectEntityWithWhere:(NSString*) where;
/**
* 根据条件升序查询
*
* @param where 条件
* @param key 排序字段
*
* @return
*/
+(NSArray*) selectEntityWithWhere:(NSString*) where byAsc:(NSString *)key;
/**
* 根据条件降序查询
*
* @param where 条件
* @param key 排序字段
*
* @return
*/
+(NSArray*) selectEntityWithWhere:(NSString*) where byDesc:(NSString *)key;
/**
* 根据条件分页查询
*
* @param page 页码
* @param where 条件
*
* @return
*/
+(NSArray*) getListByPage:(PageInfo*)page where:(NSString*)where;
+(NSArray*) getSortDescriptors;
//保存实体
+(void) saveEntity;
/**
* 删除实体
* @param entity
*/
+(void) removeEntity:(HSDBaseEtt*) entity;
/**
* 删除所有实体
*/
+(void) removeAll;
/**
* 按条件删除实体
*
* @param where
*/
+(void) removeWithWhere:(NSString*) where;
/**
* 按条件删除实体保存
*
* @param where
* @param save
*/
+(void) removeWithWhere:(NSString*) where SaveContext:(BOOL) save;
/**
* 判断两个实体是否相等
*
* @param entity 对比实体
*
* @return 是否相等
*/
-(BOOL) isEqualToEntity:(BaseEtt*) entity;
@end