-
-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3237 from ebean-orm/feature/3233
#3234 - Query Bean Generator Generates Non-Compilable Code When Entit…
- Loading branch information
Showing
2 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
ebean-querybean/src/test/java/org/example/domain/other/OtherSiteUser.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters