A. Not getting how to do this using annotations -
Eg.
class Param {
Constant cons;
}
class Constant { // no reference to Param
}
Requirement - Table generated should be,
1. Param_Table {param_id}
2. Constant_Table {const_id, param_id}
B. Sub classing and constraint creation -
Eg.
class Param {
}
class ConstantParam extends Param {
// Mapping to const_id in Constant_Table
Constant cons;
}
class OtherParam extends Param {
// NOT Mapping to other_id in Other_Table
Integer other;
}
class Constant {}
Param_Table {param_id, value_id} value_id points to const_id or other_id
Constant_Table {const_id}
Other_Table {other_id}
Currently, it create FK constraint on "value_id" of PARAM --> "const_id" of CONSTANT
I dont want any constraint to be created on "value_id" as it can store "other_id" also.
Thanks in advance,
Arpit
|