mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#3234 - Query Bean Generator Generates Non-Compilable Code When Entity Uses @Embeddable Inner Class For Primary Key Type
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
package org.example.domain.other;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Entity
|
||||
public class OtherSiteUser {
|
||||
|
||||
@Embeddable
|
||||
public static class Id {
|
||||
|
||||
// Use siteId, userId matching by db column naming convention
|
||||
public UUID siteId;
|
||||
public UUID userId;
|
||||
|
||||
public Id(UUID siteId, UUID userId) {
|
||||
this.siteId = siteId;
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
Id that = (Id) o;
|
||||
return Objects.equals(siteId, that.siteId) && Objects.equals(userId, that.userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(siteId, userId);
|
||||
}
|
||||
}
|
||||
|
||||
@EmbeddedId
|
||||
Id id;
|
||||
|
||||
String description;
|
||||
|
||||
@Version
|
||||
long version;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user