private ClassMapping getDefiningMapping(FieldMapping field) { ClassMapping clm = field.getDefiningMapping(); ValueMappingImpl value = (ValueMappingImpl)clm.getEmbeddingMetaData(); if (value == null) return clm; FieldMapping field1 = value.getFieldMapping(); return getDefiningMapping(field1); }
private ClassMapping getDefiningMapping(FieldMapping field) { ClassMapping clm = field.getDefiningMapping(); ValueMappingImpl value = (ValueMappingImpl)clm.getEmbeddingMetaData(); if (value == null) return clm; FieldMapping field1 = value.getFieldMapping(); return getDefiningMapping(field1); }
private ClassMapping getDefiningMapping(FieldMapping field) { ClassMapping clm = field.getDefiningMapping(); ValueMappingImpl value = (ValueMappingImpl)clm.getEmbeddingMetaData(); if (value == null) return clm; FieldMapping field1 = value.getFieldMapping(); return getDefiningMapping(field1); }
private ClassMapping getDefiningMapping(FieldMapping field) { ClassMapping clm = field.getDefiningMapping(); ValueMappingImpl value = (ValueMappingImpl)clm.getEmbeddingMetaData(); if (value == null) return clm; FieldMapping field1 = value.getFieldMapping(); return getDefiningMapping(field1); }
private ClassMapping getOutermostDefiningMapping(ValueMetaData vm) { if (vm instanceof FieldMapping) { ClassMapping owner = ((FieldMapping)vm).getDefiningMapping(); ValueMetaData val = owner.getEmbeddingMetaData(); if (val == null) return owner; return getOutermostDefiningMapping(val); } else if (vm instanceof ValueMappingImpl) { FieldMapping owner = ((ValueMappingImpl)vm).getFieldMapping(); return getOutermostDefiningMapping(owner); } return null; }
private ClassMapping getOutermostDefiningMapping(ValueMetaData vm) { if (vm instanceof FieldMapping) { ClassMapping owner = ((FieldMapping)vm).getDefiningMapping(); ValueMetaData val = owner.getEmbeddingMetaData(); if (val == null) return owner; return getOutermostDefiningMapping(val); } else if (vm instanceof ValueMappingImpl) { FieldMapping owner = ((ValueMappingImpl)vm).getFieldMapping(); return getOutermostDefiningMapping(owner); } return null; }
private ClassMapping getOutermostDefiningMapping(ValueMetaData vm) { if (vm instanceof FieldMapping) { ClassMapping owner = ((FieldMapping)vm).getDefiningMapping(); ValueMetaData val = owner.getEmbeddingMetaData(); if (val == null) return owner; return getOutermostDefiningMapping(val); } else if (vm instanceof ValueMappingImpl) { FieldMapping owner = ((ValueMappingImpl)vm).getFieldMapping(); return getOutermostDefiningMapping(owner); } return null; }
private ClassMapping getOutermostDefiningMapping(ValueMetaData vm) { if (vm instanceof FieldMapping) { ClassMapping owner = ((FieldMapping)vm).getDefiningMapping(); ValueMetaData val = owner.getEmbeddingMetaData(); if (val == null) return owner; return getOutermostDefiningMapping(val); } else if (vm instanceof ValueMappingImpl) { FieldMapping owner = ((ValueMappingImpl)vm).getFieldMapping(); return getOutermostDefiningMapping(owner); } return null; }
/** * Return an inverse foreign key from the given related type to our table. */ private ForeignKey newInverseForeignKey(ClassMapping target) { FieldMapping field = getFieldMapping(); FieldMapping mapped = field.getMappedByMapping(); if (mapped == null) throw new MetaDataException(_loc.get("cant-inverse", this)); mapped = target.getFieldMapping(mapped.getIndex()); if (mapped == null || mapped.getTypeCode() != JavaTypes.PC) throw new MetaDataException(_loc.get("no-equiv-mapped-by", this, target, field.getMappedBy())); return mapped.getForeignKey(); }
/** * Return an inverse foreign key from the given related type to our table. */ private ForeignKey newInverseForeignKey(ClassMapping target) { FieldMapping field = getFieldMapping(); FieldMapping mapped = field.getMappedByMapping(); if (mapped == null) throw new MetaDataException(_loc.get("cant-inverse", this)); mapped = target.getFieldMapping(mapped.getIndex()); if (mapped == null || mapped.getTypeCode() != JavaTypes.PC) throw new MetaDataException(_loc.get("no-equiv-mapped-by", this, target, field.getMappedBy())); return mapped.getForeignKey(); }
/** * Return an inverse foreign key from the given related type to our table. */ private ForeignKey newInverseForeignKey(ClassMapping target) { FieldMapping field = getFieldMapping(); FieldMapping mapped = field.getMappedByMapping(); if (mapped == null) throw new MetaDataException(_loc.get("cant-inverse", this)); mapped = target.getFieldMapping(mapped.getIndex()); if (mapped == null || mapped.getTypeCode() != JavaTypes.PC) throw new MetaDataException(_loc.get("no-equiv-mapped-by", this, target, field.getMappedBy())); return mapped.getForeignKey(); }
/** * Return an inverse foreign key from the given related type to our table. */ private ForeignKey newInverseForeignKey(ClassMapping target) { FieldMapping field = getFieldMapping(); FieldMapping mapped = field.getMappedByMapping(); if (mapped == null) throw new MetaDataException(_loc.get("cant-inverse", this)); mapped = target.getFieldMapping(mapped.getIndex()); if (mapped == null || mapped.getTypeCode() != JavaTypes.PC) throw new MetaDataException(_loc.get("no-equiv-mapped-by", this, target, field.getMappedBy())); return mapped.getForeignKey(); }
/** * Return an inverse foreign key from the given related type to our table. */ private ForeignKey newInverseForeignKey(ClassMapping target) { FieldMapping field = getFieldMapping(); FieldMapping mapped = field.getMappedByMapping(); if (mapped == null) throw new MetaDataException(_loc.get("cant-inverse", this)); mapped = target.getFieldMapping(mapped.getIndex()); if (mapped == null || mapped.getTypeCode() != JavaTypes.PC) throw new MetaDataException(_loc.get("no-equiv-mapped-by", this, target, field.getMappedBy())); return mapped.getForeignKey(); }
/** * The mapping's primary table. */ public Table getTable() { if (_fk != null) return _fk.getTable(); if (_val.getForeignKey() != null) return _val.getForeignKey().getTable(); // if this is a map of bi-directional relation, // the column of this field should be in the table // of the entity that is the value of the map if (_val.getDeclaredTypeCode() == JavaTypes.MAP) { ClassMapping meta = _elem.getDeclaredTypeMapping(); if (meta != null) return meta.getTable(); } ValueMappingImpl vm = (ValueMappingImpl)getDefiningMapping(). getEmbeddingMetaData(); if (vm != null && vm.getValueMappedBy() != null) { return vm.getFieldMapping().getElementMapping(). getDeclaredTypeMapping().getTable(); } return getDefiningMapping().getTable(); }
/** * The mapping's primary table. */ public Table getTable() { if (_fk != null) return _fk.getTable(); if (_val.getForeignKey() != null) return _val.getForeignKey().getTable(); // if this is a map of bi-directional relation, // the column of this field should be in the table // of the entity that is the value of the map if (_val.getDeclaredTypeCode() == JavaTypes.MAP) { ClassMapping meta = _elem.getDeclaredTypeMapping(); if (meta != null) return meta.getTable(); } ValueMappingImpl vm = (ValueMappingImpl)getDefiningMapping(). getEmbeddingMetaData(); if (vm != null && vm.getValueMappedBy() != null) { return vm.getFieldMapping().getElementMapping(). getDeclaredTypeMapping().getTable(); } return getDefiningMapping().getTable(); }
/** * The mapping's primary table. */ public Table getTable() { if (_fk != null) return _fk.getTable(); if (_val.getForeignKey() != null) return _val.getForeignKey().getTable(); // if this is a map of bi-directional relation, // the column of this field should be in the table // of the entity that is the value of the map if (_val.getDeclaredTypeCode() == JavaTypes.MAP) { ClassMapping meta = _elem.getDeclaredTypeMapping(); if (meta != null) return meta.getTable(); } ValueMappingImpl vm = (ValueMappingImpl)getDefiningMapping(). getEmbeddingMetaData(); if (vm != null && vm.getValueMappedBy() != null) { return vm.getFieldMapping().getElementMapping(). getDeclaredTypeMapping().getTable(); } return getDefiningMapping().getTable(); }
/** * The mapping's primary table. */ public Table getTable() { if (_fk != null) return _fk.getTable(); if (_val.getForeignKey() != null) return _val.getForeignKey().getTable(); // if this is a map of bi-directional relation, // the column of this field should be in the table // of the entity that is the value of the map if (_val.getDeclaredTypeCode() == JavaTypes.MAP) { ClassMapping meta = _elem.getDeclaredTypeMapping(); if (meta != null) return meta.getTable(); } ValueMappingImpl vm = (ValueMappingImpl)getDefiningMapping(). getEmbeddingMetaData(); if (vm != null && vm.getValueMappedBy() != null) { return vm.getFieldMapping().getElementMapping(). getDeclaredTypeMapping().getTable(); } return getDefiningMapping().getTable(); }