We are thinking about switching from our custom made code to an ORM, in order to simplify our code base and move to a possibly more robust code. Currently we have a few "system" tables and a variable number of "custom" tables. Those custom tables are different for each installation: a customer may have tables about invoices, anther may have tables about insurance policies, and so on. These custom tables may be added any time and should be immediately available to the users. We wrote a bunch of java classes following the DBO schema: a class for each system table, plus one generic class for the custom tables. And, we have a generic java object that instantiate the custom records; this class have generic methods like Object getProperty(String name)
.
We had a look at a few ORMs, but we could not find any that will simplify the use of such custom tables.
Is there anyone with similar experience? Thanks.
Java - Build a Dynamic Table. This example opens an existing report and adds a data source, data set and a table. The table columns are dynamically created based on an ArrayList that is passed in. The columns must exist in the query that is passed in.
To create a dynamic table in Excel, we have two different methods: making a table of the data from the table section while another using the offset function. The reports and pivot tables also change as the data in the dynamic table changes in dynamic tables.
Maybe it is a task for a query mapper framework better than an ORM.
For example, using MyBatis you can dynamically map even the table name (See Setting the FROM clause via parameter in MyBatis)
<select id="getLookupRows" parameterType="map" resultMap="lookupMap">
select id, name, active, valid
from ${table}
</select>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With