I have some tables with id and descriptive data. In an additional table these tables are referenced.
Table A
id int (key)
name string
description string
Table B
id int (key)
name string
description string
Table mix
id_A FK(id tableA)
id_B FK(id tableB)
If i now create a datatable for the mix table
web mvc datatables add --type ~.web.mixController
all fields (name and description) of table A and B are shown.
1) How can I change this that only the name is shown?
2) It seems that filtering on the reference columns is not working? I get an exception: org.gvnix.web.datatables.util.DatatablesUtils - Exception preparing filter for entity
The easiest way to modify the a entity representation is customize its
toString
method. By default, Spring Roo generates this as template using a Apache Commons utility which uses reflections to generate a representation string. This method is generated by@RooToString
annotation and you can found it in the{entityClass}_Roo_ToString.aj
file. To customize it just push-in (see Spring Roo documentation about it) the method.About the error, as I comment on your question, we need more information to identify the problem. Please, copy some lines of stack trace.
Regards, Chema.