is it possible to define two keys in hibernate, so i can hit the first-level-cache with both keys?
@Entity
class User {
@Id
int id;
@Id
String username;
}
so session.get(User.class, 'harry') is the same as session.get(User.class, 1)
is it possible?