I am looking for advice on how to map a properties table. Assume a schema such as:
Assuming that for OID 12 there are 2 properties (NAME and Description) I would like to map a class which looks like
I have looked at two approaches for this, and was curious if there was other:
First: Map Objects_Table to ClassA, and give it a relatioship of Properties (@OneToMany). Then, hand craft the getters and setters to manage the properties. This works fine, but searching will be a bit sketchy to code.
Second: Map both tables to ClassA using customer @Loader and @SqlInsert commands. These in turn are backed by heavily joined queries and/or stored procedures. This hides the underlieing tables (good) but requires lots of hand crafted SQL code.
Are there other approaches to this?