pessoal alguem sabe como mapear a classe do hibernate com annotations para campos do tipo image do sql-server 2005 em ambiente web. Como vai ter que ser feito, o usuario vai ter que fazer upload primeiro para depois eu persistir? ou tem como pegar direto da maquina dele sem upload e salvar no banco? e pra mostrar é apenas um get? são algumas duvidas cruéis hehee
veja como está, uso Hibernate + annotations jpa + DWR
@Entity
@Table(name="GIMAGEM")
@DataTransferObject
public class GImagem implements Serializable , Cloneable{
@Id
@RemoteProperty
@Column(name = "ID", columnDefinition = "INT")
private Integer id;
@RemoteProperty
@Column(name = "CODSISTEMA", length = 1)
private String codSistema;
@RemoteProperty
@Column(name = "IMAGEM", columnDefinition = "IMAGE")
private String imagem;
@RemoteProperty
public String getCodSistema() {
return codSistema;
}
public void setCodSistema(String codSistema) {
this.codSistema = codSistema;
}
@RemoteProperty
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@RemoteProperty
public String getImagem() {
return imagem;
}
public void setImagem(String imagem) {
this.imagem = imagem;
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final GImagem other = (GImagem) obj;
if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 7;
hash = 73 * hash + (this.id != null ? this.id.hashCode() : 0);
return hash;
}
}