Skip to content

Reusable enums / Inter-table enums #20

@Osiris-Team

Description

@Osiris-Team

To prevent ugly stuff like this:

            Review.Rating rating = values[i];
            List<ReviewRating> reviewRatings = ReviewRating.whereReviewId().is(review.id)
                    .and(ReviewRating.whereRating().is(ReviewRating.Rating.valueOf(rating.name()))).get();

Instead, it could look like this if the enum was imported instead of redefined in the other table:

            Review.Rating rating = values[i];
            List<ReviewRating> reviewRatings = ReviewRating.whereReviewId().is(review.id)
                    .and(ReviewRating.whereRating().is(rating).get();

Details: We have a enum named Rating defined twice in the Review table and the ReviewRating table even though its exactly the same enum used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions