File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
main/java/com/j256/ormlite/stmt
test/java/com/j256/ormlite/dao Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ String getSelectColumnsAsString() {
98
98
*/
99
99
public PreparedQuery <T > prepare () throws SQLException {
100
100
// we only store things in the cache if there was not selects specified
101
- boolean cacheStore = (resultFieldTypes == tableInfo . getFieldTypes () );
101
+ boolean cacheStore = (selectList == null );
102
102
return super .prepareStatement (limit , cacheStore );
103
103
}
104
104
Original file line number Diff line number Diff line change @@ -164,12 +164,13 @@ public void testQueryAll() throws Exception {
164
164
165
165
List <Foo > results = dao .queryForAll ();
166
166
assertEquals (1 , results .size ());
167
+ assertEquals (foo .id , results .get (0 ).id );
167
168
assertNotSame (foo , results .get (0 ));
168
169
169
170
Foo foo2 = dao .queryForId (foo .id );
170
171
assertNotNull (foo2 );
172
+ assertEquals (foo .id , results .get (0 ).id );
171
173
assertSame (results .get (0 ), foo2 );
172
-
173
174
}
174
175
175
176
@ Test
@@ -270,6 +271,7 @@ protected static class NoId {
270
271
int notId ;
271
272
@ DatabaseField
272
273
String stuff ;
274
+
273
275
public NoId () {
274
276
}
275
277
}
@@ -279,6 +281,7 @@ protected static class WithId {
279
281
int id ;
280
282
@ DatabaseField
281
283
String stuff ;
284
+
282
285
public WithId () {
283
286
}
284
287
}
@@ -288,6 +291,7 @@ protected static class Parent {
288
291
int id ;
289
292
@ DatabaseField (foreign = true , foreignAutoRefresh = true )
290
293
Child child ;
294
+
291
295
public Parent () {
292
296
}
293
297
}
@@ -297,6 +301,7 @@ protected static class Child {
297
301
int id ;
298
302
@ ForeignCollectionField
299
303
ForeignCollection <Parent > parents ;
304
+
300
305
public Child () {
301
306
}
302
307
}
You can’t perform that action at this time.
0 commit comments