play-java-ebean-example
play-java-ebean-example copied to clipboard
Why are you setting the computer id based on the time?
Why are you setting the id based on the time? In your ComputerRepository.java
public CompletionStage<Long> insert(Computer computer) {
return supplyAsync(() -> {
computer.id = System.currentTimeMillis(); // not ideal, but it works
ebeanServer.insert(computer);
return computer.id;
}, executionContext);
}
Doesn't ebean do this automagically?
Hi @kdbeall, it is just an example, so not a big deal. But yeah, Ebean should handle it, I think.
Do you want to submit a pull request to improve this?
Thank you.