veiset
10/06/2017, 10:38 AMveiset
10/06/2017, 10:39 AMqwert_ukg
10/06/2017, 12:53 PMuser
10/06/2017, 1:27 PMfindOne(id)
can return null. besides that it's more or less how I use it.
Other option is to check if entity with id exists and just do update (without geting whole object). but it usualy is not worth itlex
10/09/2017, 3:21 AMlex
10/09/2017, 3:21 AMsdeleuze
10/09/2017, 8:31 AMJeff Banks
10/10/2017, 10:52 PMsdeleuze
10/12/2017, 12:09 PMroberto.guerra
10/12/2017, 5:39 PMrouter
dsl?fitzoh
10/12/2017, 5:40 PMroberto.guerra
10/12/2017, 5:40 PMfitzoh
10/12/2017, 5:41 PMpavel
10/12/2017, 6:05 PMsnowe
10/12/2017, 6:38 PMroberto.guerra
10/12/2017, 6:58 PMjson()
on ok()
, but json
is not popping up for meroberto.guerra
10/12/2017, 6:59 PMServerResponse.BodyBuilder
doesn’t seem to have a json
function either https://docs.spring.io/spring/docs/5.0.0.M3/javadoc-api/org/springframework/web/reactive/function/ServerResponse.BodyBuilder.htmlsdeleuze
10/13/2017, 7:41 AMsdeleuze
10/13/2017, 7:45 AMjson()
is a project specific extension, see https://github.com/mixitconf/mixit/blob/master/src/main/kotlin/mixit/util/Extensions.kt#L38sdeleuze
10/13/2017, 7:46 AMsdeleuze
10/13/2017, 7:48 AMlex
10/13/2017, 8:13 AMlex
10/13/2017, 8:17 AMsdeleuze
10/13/2017, 8:19 AMsdeleuze
10/13/2017, 8:19 AMsdeleuze
10/13/2017, 8:20 AMtiare.balbi
10/13/2017, 9:29 AMsdeleuze
10/13/2017, 9:48 AMsdeleuze
10/13/2017, 10:20 AMCrudRepository#findById
now returns Optional<T>
because that's best practice in Java 8. If you prefer a more idiomatic T?
return type you can probably directly extends Repository
and specify your own fun findById(): T?
or continue to extends CrudRepository
and add a fun findByXxx(): T?
function, like fun findByUsername(): T?
or fun findByNulllableId(): T?
sdeleuze
10/13/2017, 10:20 AM