Hi,
I have a database (either mysql or a &%$# ms access file) and I'm trying to generate Java classes using Hibernate Tools inside Eclipse, and everything's fine except one thing: I have unfortunately column names with spaces inside (e.g. "Some name").
Now the SQL Hibernate generates (from a "from table" query) is
Code:
select ... table.Some name as ... ... from ...
which is obviously wrong (because of the space). I've made a little fix adding the ` to the name attribute:
I have changed the generated:
Code:
@Column(name = "Some name")
public Byte getSomeName() {
return this.someName;
}
to
Code:
@Column(name = "`Some name`")
public Byte getSomeName() {
return this.someName;
}
And it works, but I have plenty of tables and plenty of such columns, is there any way to instruct the code generator to do it automatically? I have my own
Code:
public class PemNamingStrategy extends DelegatingReverseEngineeringStrategy { ...
maybe there's a possibility to make this 'fix' there? What am I doing wrong?
If needed, I can paste all the configuration I have, but I do not think it's necessary
--
Regards,
Kornel