I've read your post several times but I'm not sure to understand what you mean.
I't seems you want to eliminate blank spaces from the begining and the end of your string. You have a function to do that in the Java API, trim().
If what you want is to access to the string directly and don't know where to put the function call, mind that hibernate works through reflection and access your properies using setters and getters, so, instead of the classical:
void setProperty(String property) {
this.property = property;
}
String getProperty() {
return(this.property);
}
you can use:
void setProperty(String property) {
this.property=property.trim();
}
String getProperty() {
return(this.property.trim();
}
Don't know if that was what you was looking for. Hope it helps.
|