NullPointerException in 0.6

View: New views
2 Messages — Rating Filter:   Alert me  

NullPointerException in 0.6

by petar :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi!

@javax.persistence.Table is not required for entities (default is class name)

but you assume this in DbMappings.getMappings:

Table t = (Table) cls.getAnnotation(Table.class);
mappings.tableName = t.name();

The same is true for Column:
Column c = (Column) f.getAnnotation(Column.class);
mappings.idField = c.name();

Regards,
Peter.

Re: NullPointerException in 0.6

by wfaler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
Yes, I am aware of this bug, and should get around to fix it for 0.7. At the moment it assumes both Table and Column annotations with name attributes presents.

Thanks for reminding me!

petar wrote:
Hi!

@javax.persistence.Table is not required for entities (default is class name)

but you assume this in DbMappings.getMappings:

Table t = (Table) cls.getAnnotation(Table.class);
mappings.tableName = t.name();

The same is true for Column:
Column c = (Column) f.getAnnotation(Column.class);
mappings.idField = c.name();

Regards,
Peter.