-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 #7527 from loicmathieu/feat/delete-by-id
Panache : deleteById()
- Loading branch information
Showing
20 changed files
with
323 additions
and
38 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
49 changes: 49 additions & 0 deletions
49
...ests/hibernate-orm-panache/src/main/java/io/quarkus/it/panache/ObjectWithCompositeId.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,49 @@ | ||
package io.quarkus.it.panache; | ||
|
||
import java.io.Serializable; | ||
import java.util.Objects; | ||
|
||
import javax.persistence.Entity; | ||
import javax.persistence.Id; | ||
import javax.persistence.IdClass; | ||
|
||
import io.quarkus.hibernate.orm.panache.PanacheEntityBase; | ||
|
||
@Entity | ||
@IdClass(ObjectWithCompositeId.ObjectKey.class) | ||
public class ObjectWithCompositeId extends PanacheEntityBase { | ||
@Id | ||
public String part1; | ||
@Id | ||
public String part2; | ||
public String description; | ||
|
||
static class ObjectKey implements Serializable { | ||
private String part1; | ||
private String part2; | ||
|
||
public ObjectKey() { | ||
} | ||
|
||
public ObjectKey(String part1, String part2) { | ||
this.part1 = part1; | ||
this.part2 = part2; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) | ||
return true; | ||
if (o == null || getClass() != o.getClass()) | ||
return false; | ||
ObjectKey objectKey = (ObjectKey) o; | ||
return part1.equals(objectKey.part1) && | ||
part2.equals(objectKey.part2); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(part1, part2); | ||
} | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
...sts/hibernate-orm-panache/src/main/java/io/quarkus/it/panache/ObjectWithEmbeddableId.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 io.quarkus.it.panache; | ||
|
||
import java.io.Serializable; | ||
import java.util.Objects; | ||
|
||
import javax.persistence.Embeddable; | ||
import javax.persistence.EmbeddedId; | ||
import javax.persistence.Entity; | ||
|
||
import io.quarkus.hibernate.orm.panache.PanacheEntityBase; | ||
|
||
@Entity | ||
public class ObjectWithEmbeddableId extends PanacheEntityBase { | ||
@EmbeddedId | ||
public ObjectKey key; | ||
public String description; | ||
|
||
@Embeddable | ||
static class ObjectKey implements Serializable { | ||
private String part1; | ||
private String part2; | ||
|
||
public ObjectKey() { | ||
} | ||
|
||
public ObjectKey(String part1, String part2) { | ||
this.part1 = part1; | ||
this.part2 = part2; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) | ||
return true; | ||
if (o == null || getClass() != o.getClass()) | ||
return false; | ||
ObjectKey objectKey = (ObjectKey) o; | ||
return part1.equals(objectKey.part1) && | ||
part2.equals(objectKey.part2); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(part1, part2); | ||
} | ||
} | ||
} |
Oops, something went wrong.