Files
ebean/ebean-querybean/src/test/java/org/example/domain/CaoKey.java
T
Rob Bygrave f03892a4bd #3216 - Fix querybean generation for @Embedded beans (fix for 13.22.0 change)
Version 13.22.0 added a change to query bean generation that has an issue for
embedded beans. This fixes that issue.
2023-09-11 23:01:44 +12:00

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;
}
}