Hi!
i have a problem with fields in database type char(*)
In my firebird database fields of type char(2) and char(9), i'm trying to mapping them in my entities.
example:
Code:
public class Endereco implements Serializable {
...
@Column(name = "ESTADO")
@Type(type="character")
private String estado;
@Column(name = "CEP")
@Type(type="character")
private String cep;
...
public String getEstado() {
return estado;
}
public void setEstado(String estado) {
this.estado = estado;
}
public String getCep() {
return cep;
}
public void setCep(String cep) {
this.cep = cep;
}
}
when i use
@Type(type="character") returns a propertyexception:
Quote:
could not set a field value by reflection setter of br.com.theos.client.database.entities.Endereco.cep
and when not use
@Type return error:
Quote:
Wrong column type: CEP, expected: varchar(255)
looking this post:
http://blogs.warwick.ac.uk/colinyates/e ... hibernate/i updated all fields null to '88888-888' and and still the same error
also tried to change the type to char[] :(
I do not use persistence.xml, AnnotationConfiguration am using to connect to the bank and mapping of classes.
Sample:
http://www.edmafer.com.br/?p=230another attempt to define the type:
Code:
@TypeDef(typeClass=org.hibernate.type.CharacterArrayType.class, name="mchartype")
and
Code:
@Type(type="mchartype")
but return
Wrong column...