Hello
I'm using Hibernate 3.3.2.GA and an Oracle database
I'm trying to generate javadoc comments from tables and/or columns comments in a Oracle database.
Some way to do this?
I have this SQL code defined in a table:
SQLCode:
COMMENT ON TABLE "ITEM" IS 'Table of items';
COMMENT ON COLUMN "ITEM"."CODE" IS 'Code';
COMMENT ON COLUMN "ITEM"."NAME" IS 'Description';
COMMENT ON COLUMN "ITEM"."BLOCKED" IS 'Blocked';
in my PojoFields.ftl template I have:
PojoFields.ftlCode:
<#foreach property in entitygen.getAllPropertiesIterator()>
<#if pojo.hasMetaAttribute(property, "field-description")>
/**
${pojo.getFieldJavaDoc(property, 0)}
*/
</#if>
// código para gerar os campos...
...
The problem is:
pojo.hasMetaAttribute() return false and
getFieldJavaDoc() return empty.
I've tried with
pojo.getFieldDescription() and the result are the same.
With
OracleMetadataDialect I see that comments are visible and are stored in REMARKS
Code:
public Iterator getColumns(final String catalog, final String schema, final String table, String column)
...
element.put("COLUMN_NAME", rs.getString(1));
element.put("TABLE_SCHEM", rs.getString(2));
element.put("NULLABLE", new Integer(rs.getInt(3)));
element.put("COLUMN_SIZE", new Integer(rs.getInt(4)));
element.put("DATA_TYPE", new Integer(rs.getInt(5)));
element.put("TABLE_NAME", rs.getString(6));
element.put("TYPE_NAME", rs.getString(7));
element.put("DECIMAL_DIGITS", new Integer(rs.getInt(8)));
element.put("TABLE_CAT", null);
element.put("REMARKS", rs.getString(9));
...
Only here I can view the comments that have been properly loaded
Should I put the comments in another place (not in REMARKS)? I tried but i have the same result...
Can anyone help?