Details
-
Improvement
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
-
None
-
0
Description
Hi
I think it would be interesting to group common attributes of save operations (InsertOptions.java, ReplaceOptions.java and UpsertOptions.java). This new class would extend CommonDurabilityOptions.
The main reason, besides simplicity, is that in spring-data-couchbase, at repository layer, you can do the following:
@Repository
|
public interface AirlineRepository extends CouchbaseRepository<Airline, String>, DynamicProxyable<AirlineRepository> {..} |
@Test public void testExpiration() { Airport airport = new Airport("1", "iata21", "icao21"); airportRepository.withOptions(InsertOptions.insertOptions().expiry(Duration.ofSeconds(10))).save(airport); Airport foundAirport = airportRepository.findByIata(airport.getIata()); assertNotEquals(0, foundAirport.getExpiration()); airportRepository.delete(airport); } |
In that layer, knowing whether to use InsertOptions, ReplaceOptions or UpsertOptions is not straightforward so it would be nice to at least use a common object for the save options (in principle the properties would be expiry and transcoder).
How do you see it?
Thank you very much in advance
Attachments
Issue Links
- is duplicated by
-
JVMCBC-1474 Grouping common attributes of InsertOptions, ReplaceOptions and UpsertOptions
- Closed