My favorites | Sign in
Project Home Downloads Issues Source
Checkout   Browse   Changes    
 
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
/**
* Copyright (C) 2010 altuure <altuure [AT] gmail [DOT] com> http://www.altuure.com/projects/yagdao
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.altuure.yagdao.dao;

import com.altuure.yagdao.*;
import com.altuure.yagdao.model.SimpleBean;

import java.util.List;

/**
* sample dao for test
* @see SimpleBean
*/
public interface SimpleBeanNewDAO extends GenericDAO<SimpleBean, Long> {

/***
* check if old version compatible
* @param arg1
* @return
*/
@YMethod(type = YMethodType.CRITERIA)
SearchResultList<SimpleBean> criteria0(@YParameter("pbyte") byte arg1);
/**
* Sample criteria builder
* @param arg1 optional parameter 1
* @return list of entities
*/
@YMethod(type = YMethodType.CRITERIA)
SearchResultList<SimpleBean> criteria1(@YParameter("pint >=") Integer arg1);


@YMethod(type = YMethodType.CRITERIA)
SearchResultList<Object> criteria1CheckApplied(@YParameter("pint>=20000") boolean apply);

@YMethod(type = YMethodType.CRITERIA)
SearchResultList<SimpleBean> criteria2(@YParameter("pint >=") Integer arg1,@YParameter("pint <=") Integer arg2);

@YMethod(type = YMethodType.CRITERIA)
SearchResultList<SimpleBean> criteria3(@YParameter("pstring is null") boolean apply);


@YMethod(type = YMethodType.CRITERIA)
SearchResultList<Object> criteria2CheckApplied(@YParameter("pint>=20000") boolean apply1,@YParameter( "pint<=50000") boolean apply2);

@YMethod(type = YMethodType.CRITERIA,where="pint>=20000 and pint<=50000" )
SearchResultList<Object> criteriaWhereAnd();
@YMethod(type = YMethodType.CRITERIA,where="pint>=50000 OR pint<=30000" )
SearchResultList<Object> criteriaWhereOr();


@YMethod(type = YMethodType.CRITERIA)
SearchResultList<SimpleBean> criteria3(@YParameter("? <=pint") Integer arg1);

@YMethod(type = YMethodType.CRITERIA,
groupBy="pbyte",
select="count(id),pbyte")
List<Object[]> criteriaGroup1();

@YMethod(type = YMethodType.CRITERIA,
groupBy="pbyte",
select="count(id),pbyte,sum(pint)",
having="count(id)>9")
List<Object[]> criteriaGroupHaving();

@YMethod(type = YMethodType.CRITERIA,
select="id,year(pdate),month(pdate),day(pdate),hour(pdate),minute(pdate),second(pdate),currenttime(),currenttimestamp(),currentdate()"
,where="id=2")
List<Object[]> criteriaDateFunctions();

@YMethod(type = YMethodType.CRITERIA,
groupBy="month(pdate)",
select="count(id),month(pdate)")
List<Object[]> criteriaGroup2();

/*@YMethod(type = YMethodType.CRITERIA)
SearchResultList<SimpleBean> criteria1(@YParameter(value = "pint", operator = YOperator.GE) Integer arg1, YPage page);

@YMethod(type = YMethodType.CRITERIA, select = "pint")
SearchResultList<Object> criteriaSelected1(@YParameter(value = "pint", operator = YOperator.GE) Integer arg1);


@YMethod(type = YMethodType.CRITERIA, select = "pint,pdate" )
SearchResultList<Object[]> criteriaSelected2(@YParameter(value = "pint", operator = YOperator.GE) Integer arg1);

@YMethod(type = YMethodType.CRITERIA)
SearchResultList<SimpleBean> criteria2(@YParameter(value = "pint", operator = YOperator.GE) Integer arg1,
@YParameter(value = "pdate", operator = YOperator.LE) Date arg2

);

@YMethod(type = YMethodType.CRITERIA)
SearchResultList<SimpleBean> criteria2(@YParameter(value = "pint", operator = YOperator.GE) Integer arg1,
@YParameter(value = "pdate", operator = YOperator.LE) Date arg2, YPage page);

@YMethod(type = YMethodType.CRITERIA)
SearchResultList<SimpleBean> criteriaBetween(@YParameter(value = "pint", operator = YOperator.BETWEEN) Integer[] arg);

@YMethod(type = YMethodType.CRITERIA)
SearchResultList<SimpleBean> criteriaIn(@YParameter(value = "pint", operator = YOperator.IN) Integer[] arg);

@YMethod(type = YMethodType.CRITERIA)
SearchResultList<SimpleBean> criteriaEqual(@YParameter(value = "pbyte", operator = YOperator.EQUAL) byte arg);

@YMethod(type = YMethodType.CRITERIA)
SearchResultList<SimpleBean> criteriaNotEqual(
@YParameter(value = "pbyte", operator = YOperator.EQUAL, not = true) byte arg);

@YMethod(type = YMethodType.CRITERIA)
SearchResultList<SimpleBean> criteriaLE(@YParameter(value = "pint", operator = YOperator.LE) Integer arg);

@YMethod(type = YMethodType.CRITERIA)
List<SimpleBean> criteriaLTList(@YParameter(value = "pint", operator = YOperator.LT) Integer arg);

@YMethod(type = YMethodType.CRITERIA)
SearchResultList<SimpleBean> criteriaLT(@YParameter(value = "pint", operator = YOperator.LT) Integer arg);

@YMethod(type = YMethodType.CRITERIA)
SearchResultList<SimpleBean> criteriaGELT(@YParameter(value = "pint", operator = YOperator.GE) Integer min,
@YParameter(value = "pint", operator = YOperator.LT) Integer maxE);

@YMethod(type = YMethodType.CRITERIA)
SearchResultList<SimpleBean> criteriaGT(@YParameter(value = "pint", operator = YOperator.GT) Integer arg);

@YMethod(type = YMethodType.CRITERIA)
SearchResultList<SimpleBean> criteriaGE(@YParameter(value = "pint", operator = YOperator.GE) Integer arg);

@YMethod(type = YMethodType.CRITERIA)
SearchResultList<SimpleBean> criteriaULike(@YParameter(value = "pstring", operator = YOperator.ULIKE) String arg);

@YMethod(type = YMethodType.CRITERIA)
SearchResultList<SimpleBean> criteriaLike(@YParameter(value = "pstring", operator = YOperator.LIKE) String arg);

@YMethod(type = YMethodType.CRITERIA, orderBy = "pint desc")
SearchResultList<SimpleBean> preDefinedOrder1(@YParameter(value = "pbyte", operator = YOperator.EQUAL) byte arg);

@YMethod(type = YMethodType.CRITERIA, orderBy = "pint asc")
SearchResultList<SimpleBean> preDefinedOrder2(@YParameter(value = "pbyte", operator = YOperator.EQUAL) byte arg,
YLimit limits);

@YMethod(type = YMethodType.CRITERIA, orderBy = "pint desc")
SearchResultList<SimpleBean> preDefinedOrder3(@YParameter(value = "pbyte", operator = YOperator.EQUAL) byte arg,
YPage page);

@YMethod(type = YMethodType.COUNT)
long count1(@YParameter(value = "pint", operator = YOperator.GE) Integer arg1);

@YMethod(type = YMethodType.COUNT)
long count2(@YParameter(value = "pint", operator = YOperator.GE) Integer arg1,
@YParameter(value = "pdate", operator = YOperator.LE) Date arg2);

@YMethod(type = YMethodType.EXECUTE,query = "update SimpleBean set pint=:newInt where id=:id ")
int execute1(@YParameter(value = "newInt") int newInt,@YParameter(value = "id") long id);
*/
}

Change log

r59 by mcakkan on Dec 9, 2010   Diff
[maven-release-plugin]  copy for tag
com.altuure.yagdao-0.3
Go to: 
Project members, sign in to write a code review

Older revisions

r48 by mcakkan on Dec 4, 2010   Diff
optimize imports
r44 by mcakkan on Dec 1, 2010   Diff
jpa release ready
r43 by mcakkan on Nov 30, 2010   Diff
jpa final , almost
All revisions of this file

File info

Size: 7476 bytes, 168 lines
Powered by Google Project Hosting