We have following two tables. Item: item_id, name
ItemInfo: id, item_id, info_id, item_info
Item table can have multiple entries in ItemInfo.
I want to join above two tables at the same time I want to get the entries from the Item table which may not have any associated entry in ItemInfo. How can I do achieve this with the Hibernate criteria?
public class Item {
private long item_id;
private String name;
public long getItem_id() {
return item_id;
}
public void setItem_id(long item_id) {
this.item_id = item_id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
public class ItemInfo {
private long id;
private long item_id;
private String item_info;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public long getItem_id() {
return item_id;
}
public void setItem_id(long item_id) {
this.item_id = item_id;
}
public String getItem_info() {
return item_info;
}
public void setItem_info(String item_info) {
this.item_info = item_info;
}
}