mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Version 13.22.0 added a change to query bean generation that has an issue for embedded beans. This fixes that issue.
43 lines
708 B
Java
43 lines
708 B
Java
package org.example.domain;
|
|
|
|
import javax.persistence.Embeddable;
|
|
|
|
@Embeddable
|
|
public class CaoKey {
|
|
|
|
private final int customer;
|
|
private final int type;
|
|
|
|
public CaoKey(int customer, int type) {
|
|
this.customer = customer;
|
|
this.type = type;
|
|
}
|
|
|
|
public int customer() {
|
|
return customer;
|
|
}
|
|
|
|
public int type() {
|
|
return type;
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
int hc = 31 * 7 + customer;
|
|
hc = 31 * hc + type;
|
|
return hc;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object o) {
|
|
if (this == o) {
|
|
return true;
|
|
}
|
|
if (o instanceof CaoKey) {
|
|
CaoKey k = (CaoKey) o;
|
|
return k.customer == customer && k.type == type;
|
|
}
|
|
return false;
|
|
}
|
|
}
|