[b]Hibernate version: 3.2.3[/b]
[b]Name and version of the database you are using: MS-SQL 2000[/b]
[b]Hibernate Tools 3.1.0.beta5[/b]
I am using the reverse engineering tool to create POJO's from an existing database (schema).
Unfortunately, one of the tables names happens to be the same as a Java reserved word (i.e. Switch). The tool creates the .java code and uses the lower case 'switch' as the name of field (if the the table is referenced by another table). This causes the Java code not to compile! E.g:
[code]
/**
* ActiveEndpoint generated by hbm2java
*/
public class ActiveEndpoint implements java.io.Serializable {
// Fields
private Switch switch;
private Set<H323activeEndpoint> h323activeEndpoints = new HashSet<H323activeEndpoint>(0);
...
/**
* Switch generated by hbm2java
*/
public class Switch implements java.io.Serializable {
// Fields
private int id;
private String name;
...
[/code]
Is there any way of working around this problem. Explicitly forcing the name to something else in hibernate.reveng.xml (e.g. Switch -> CTISwitch) does not help - the field name remains the same even if the class name changes.
Should this be logged as a bug/feature request. (Ideally, the generated code should compile out of the box)
|