@@ -393,7 +393,7 @@ private <T extends Model> T setRaw(String attributeName, Object value) {
393
393
* (Instance state differs from state in DB)
394
394
* @return true if this instance was modified.
395
395
*/
396
-
396
+
397
397
public boolean isModified () {
398
398
return !dirtyAttributeNames .isEmpty ();
399
399
}
@@ -439,7 +439,7 @@ public static List<Association> associations() {
439
439
*
440
440
* @return true if this is a new instance, not saved yet to DB, false otherwise
441
441
*/
442
-
442
+
443
443
public boolean isNew (){
444
444
return getId () == null && !compositeKeyPersisted ;
445
445
}
@@ -2204,7 +2204,7 @@ public static void callbackWith(CallbackListener... listeners) {
2204
2204
*
2205
2205
* @return true if no errors were generated, otherwise returns false.
2206
2206
*/
2207
-
2207
+
2208
2208
public boolean isValid (){
2209
2209
validate ();
2210
2210
return !hasErrors ();
@@ -2338,32 +2338,10 @@ public static <T extends Model> T createIt(Object ... namesAndValues){
2338
2338
return ModelDelegate .createIt (Model .<T >modelClass (), namesAndValues );
2339
2339
}
2340
2340
2341
- /**
2342
- * Finds ain instance of a model by ID.
2343
- * @param id value to look for
2344
- * @return instance of a model or null if nothing found
2345
- */
2346
2341
public static <T extends Model > T findById (Object id ) {
2347
2342
return ModelDelegate .findById (Model .<T >modelClass (), id );
2348
2343
}
2349
2344
2350
- /**
2351
- * Searches for records by a collection of values in a column. This is a workaround for queries using an IN list:
2352
- * <code>select * from users where first_name in ('John', 'Jodi')</code>.
2353
- * Example of usage:
2354
- * <pre>
2355
- * List<Person> people = Person.findByColumnIn("id", li(1, 2)).orderBy("id");
2356
- *</pre>
2357
- * In the code above the search is happening by column "id" for values matching 1 or 2.
2358
- * The <code>orderBy(...)</code> is optional (same for any other methods of a <code>LazyList</code>).
2359
- *
2360
- * @param column name of column of interest.
2361
- * @param values number of matching values for this column.
2362
- * @return a number or matching objects.
2363
- */
2364
- public static <T extends Model > LazyList <T > findByColumnIn (String column , Collection <?> values ) {
2365
- return ModelDelegate .findByColumnIn (Model .<T >modelClass (), column , values );
2366
- }
2367
2345
/**
2368
2346
* Composite PK values in exactly the same order as specified in {@link CompositePK}.
2369
2347
*
@@ -2959,7 +2937,7 @@ public static String getTableName() {
2959
2937
*
2960
2938
* @return of ID.
2961
2939
*/
2962
-
2940
+
2963
2941
public Object getId () {
2964
2942
return get (getIdName ());
2965
2943
}
@@ -2969,7 +2947,7 @@ public Object getId() {
2969
2947
*
2970
2948
* @return Name of ID column.
2971
2949
*/
2972
-
2950
+
2973
2951
public String getIdName () {
2974
2952
return metaModelLocal .getIdName ();
2975
2953
}
@@ -2979,7 +2957,7 @@ public String getIdName() {
2979
2957
*
2980
2958
* @return a list of composite keys as specified in {@link CompositePK}.
2981
2959
*/
2982
-
2960
+
2983
2961
public String [] getCompositeKeys () {
2984
2962
return metaModelLocal .getCompositeKeys ();
2985
2963
}
@@ -3111,7 +3089,7 @@ public static void purgeCache() {
3111
3089
*
3112
3090
* @return value of attribute corresponding to <code>getIdName()</code>, converted to a Long.
3113
3091
*/
3114
-
3092
+
3115
3093
public Long getLongId () {
3116
3094
return getId () == null ? null : Convert .toLong (getId ());
3117
3095
}
0 commit comments