Skip to content
This repository has been archived by the owner on Apr 23, 2019. It is now read-only.

Why are you setting the computer id based on the time? #66

Open
kdbeall opened this issue Feb 18, 2018 · 2 comments
Open

Why are you setting the computer id based on the time? #66

kdbeall opened this issue Feb 18, 2018 · 2 comments

Comments

@kdbeall
Copy link

kdbeall commented Feb 18, 2018

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);
    }
@kdbeall
Copy link
Author

kdbeall commented Feb 18, 2018

Doesn't ebean do this automagically?

@marcospereira
Copy link
Member

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants