@Target(value=TYPE) @Retention(value=RUNTIME) public @interface DefaultNullSavingStrategy
Dao
interface to define a default NullSavingStrategy
, that will apply
to all methods that don't explicitly declare one.
For example, given this interface:
@Dao @DefaultNullSavingStrategy(SET_TO_NULL) public interface ProductDao { @Insert void insert(Product product); @Update(nullSavingStrategy = DO_NOT_SET) void update(Product product); }
insert(Product)
will use SET_TO_NULL
(inherited from the DAO's default).
update(Product)
will use DO_NOT_SET
.
DefaultNullSavingStrategy
, any method that does
not declare its own value defaults to DO_NOT_SET
.
Note that null saving strategies are only relevant for Update
, Insert
, Query
and SetEntity
methods.
Modifier and Type | Required Element and Description |
---|---|
NullSavingStrategy |
value |
public abstract NullSavingStrategy value
Copyright © 2017–2022. All rights reserved.