how Map A CompositeUserType relationship with a many-to-one
this is my Composite class
Quote:
public class CategoriaItems
{
private Item item;
private Categoria categoria;
private String descripcion;
public Categoria getCategoria() {
return categoria;
}
public void setCategoria(Categoria categoria) {
this.categoria = categoria;
}
public Item getItem() {
return item;
}
public void setItem(Item item) {
this.item = item;
}
public String getDescripcion() {
return descripcion;
}
public void setDescripcion(String descripcion) {
this.descripcion = descripcion;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((categoria == null) ? 0 : categoria.hashCode());
result = prime * result
+ ((descripcion == null) ? 0 : descripcion.hashCode());
result = prime * result + ((item == null) ? 0 : item.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final CategoriaItems other = (CategoriaItems) obj;
if (categoria == null) {
if (other.categoria != null)
return false;
} else if (!categoria.equals(other.categoria))
return false;
if (descripcion == null) {
if (other.descripcion != null)
return false;
} else if (!descripcion.equals(other.descripcion))
return false;
if (item == null) {
if (other.item != null)
return false;
} else if (!item.equals(other.item))
return false;
return true;
}
}
please need urgent help
any ideas will be welcome