protected Object getDiscriminatorValue(ClassMapping cls) { Object val = cls.getDiscriminator().getValue(); return (val == Discriminator.NULL) ? null : val; }
protected Object getDiscriminatorValue(ClassMapping cls) { Object val = cls.getDiscriminator().getValue(); return (val == Discriminator.NULL) ? null : val; }
protected Object getDiscriminatorValue(ClassMapping cls) { Object val = cls.getDiscriminator().getValue(); return (val == Discriminator.NULL) ? null : val; }
protected Object getDiscriminatorValue(ClassMapping cls) { Object val = cls.getDiscriminator().getValue(); return (val == Discriminator.NULL) ? null : val; }
protected Object getDiscriminatorValue(ClassMapping cls) { Object val = cls.getDiscriminator().getValue(); return (val == Discriminator.NULL) ? null : val; }
/** * Map the stringified version of the discriminator value of the given type. */ private static void mapDiscriminatorValue(ClassMapping cls, Map map) { // possible that some types will never be persisted and therefore // can have no discriminator value Object val = cls.getDiscriminator().getValue(); if (val == null) return; String str = (val == Discriminator.NULL) ? null : val.toString(); Class exist = (Class) map.get(str); if (exist != null) throw new MetaDataException(_loc.get("dup-discrim-value", str, exist, cls)); map.put(str, cls.getDescribedType()); }
/** * Map the stringified version of the discriminator value of the given type. */ private static void mapDiscriminatorValue(ClassMapping cls, Map map) { // possible that some types will never be persisted and therefore // can have no discriminator value Object val = cls.getDiscriminator().getValue(); if (val == null) return; String str = (val == Discriminator.NULL) ? null : val.toString(); Class exist = (Class) map.get(str); if (exist != null) throw new MetaDataException(_loc.get("dup-discrim-value", str, exist, cls)); map.put(str, cls.getDescribedType()); }
/** * Map the stringified version of the discriminator value of the given type. */ private static void mapDiscriminatorValue(ClassMapping cls, Map map) { // possible that some types will never be persisted and therefore // can have no discriminator value Object val = cls.getDiscriminator().getValue(); if (val == null) return; String str = (val == Discriminator.NULL) ? null : val.toString(); Class exist = (Class) map.get(str); if (exist != null) throw new MetaDataException(_loc.get("dup-discrim-value", str, exist, cls)); map.put(str, cls.getDescribedType()); }
public Object load(ExpContext ctx, ExpState state, Result res) throws SQLException { Object type = null; if (_disc != null && _disc.getColumns().length > 0) { type = res.getObject(_disc.getColumns()[0], null, state.joins); ClassMapping sup = (ClassMapping) getMetaData(); ClassMapping[] subs = sup.getMappedPCSubclassMappings(); for (ClassMapping sub : subs) { if (sub.getDiscriminator().getValue().equals(type)) return sub.getDescribedType(); } } else type = getValue().load(ctx, state, res); return type.getClass(); }
public Object load(ExpContext ctx, ExpState state, Result res) throws SQLException { Object type = null; if (_disc != null && _disc.getColumns().length > 0) { type = res.getObject(_disc.getColumns()[0], null, state.joins); ClassMapping sup = (ClassMapping) getMetaData(); ClassMapping[] subs = sup.getMappedPCSubclassMappings(); for (ClassMapping sub : subs) { if (sub.getDiscriminator().getValue().equals(type)) return sub.getDescribedType(); } } else type = getValue().load(ctx, state, res); return type.getClass(); }
public Object load(ExpContext ctx, ExpState state, Result res) throws SQLException { Object type = null; if (_disc != null && _disc.getColumns().length > 0) { type = res.getObject(_disc.getColumns()[0], null, state.joins); ClassMapping sup = (ClassMapping) getMetaData(); ClassMapping[] subs = sup.getMappedPCSubclassMappings(); for (ClassMapping sub : subs) { if (sub.getDiscriminator().getValue().equals(type)) return sub.getDescribedType(); } } else type = getValue().load(ctx, state, res); return type.getClass(); }
public void calculateValue(Select sel, ExpContext ctx, ExpState state, Val other, ExpState otherState) { super.calculateValue(sel, ctx, state, other, otherState); LitExpState lstate = (LitExpState) state; lstate.mapping = (ClassMapping) getMetaData(); lstate.disc = lstate.mapping.getDiscriminator(); lstate.discValue = lstate.disc != null ? lstate.disc.getValue() : null; sel.select(((ClassMapping) getMetaData()).getPrimaryKeyColumns(), lstate.joins); }
public void calculateValue(Select sel, ExpContext ctx, ExpState state, Val other, ExpState otherState) { super.calculateValue(sel, ctx, state, other, otherState); LitExpState lstate = (LitExpState) state; lstate.mapping = (ClassMapping) getMetaData(); lstate.disc = lstate.mapping.getDiscriminator(); lstate.discValue = lstate.disc != null ? lstate.disc.getValue() : null; sel.select(((ClassMapping) getMetaData()).getPrimaryKeyColumns(), lstate.joins); }
public void calculateValue(Select sel, ExpContext ctx, ExpState state, Val other, ExpState otherState) { super.calculateValue(sel, ctx, state, other, otherState); LitExpState lstate = (LitExpState) state; lstate.mapping = (ClassMapping) getMetaData(); lstate.disc = lstate.mapping.getDiscriminator(); lstate.discValue = lstate.disc != null ? lstate.disc.getValue() : null; sel.select(((ClassMapping) getMetaData()).getPrimaryKeyColumns(), lstate.joins); }
public void calculateValue(Select sel, ExpContext ctx, ExpState state, Val other, ExpState otherState) { super.calculateValue(sel, ctx, state, other, otherState); LitExpState lstate = (LitExpState) state; lstate.mapping = (ClassMapping) getMetaData(); lstate.disc = lstate.mapping.getDiscriminator(); lstate.discValue = lstate.disc != null ? lstate.disc.getValue() : null; sel.select(((ClassMapping) getMetaData()).getPrimaryKeyColumns(), lstate.joins); }
public void map(boolean adapt) { // if a superclass maps the discriminator value, so should we. // otherwise assume it's calculated ClassMapping sup = disc.getClassMapping(). getJoinablePCSuperclassMapping(); for (; sup != null; sup = sup.getJoinablePCSuperclassMapping()) { if (sup.getDiscriminator().getValue() != null || sup.getDiscriminator().getStrategy() instanceof ValueMapDiscriminatorStrategy) { disc.setValue(disc.getMappingInfo().getValue(disc, adapt)); break; } } }
public void map(boolean adapt) { // if a superclass maps the discriminator value, so should we. // otherwise assume it's calculated ClassMapping sup = disc.getClassMapping(). getJoinablePCSuperclassMapping(); for (; sup != null; sup = sup.getJoinablePCSuperclassMapping()) { if (sup.getDiscriminator().getValue() != null || sup.getDiscriminator().getStrategy() instanceof ValueMapDiscriminatorStrategy) { disc.setValue(disc.getMappingInfo().getValue(disc, adapt)); break; } } }
public void map(boolean adapt) { // if a superclass maps the discriminator value, so should we. // otherwise assume it's calculated ClassMapping sup = disc.getClassMapping(). getJoinablePCSuperclassMapping(); for (; sup != null; sup = sup.getJoinablePCSuperclassMapping()) { if (sup.getDiscriminator().getValue() != null || sup.getDiscriminator().getStrategy() instanceof ValueMapDiscriminatorStrategy) { disc.setValue(disc.getMappingInfo().getValue(disc, adapt)); break; } } }
public void map(boolean adapt) { // if a superclass maps the discriminator value, so should we. // otherwise assume it's calculated ClassMapping sup = disc.getClassMapping(). getJoinablePCSuperclassMapping(); for (; sup != null; sup = sup.getJoinablePCSuperclassMapping()) { if (sup.getDiscriminator().getValue() != null || sup.getDiscriminator().getStrategy() instanceof ValueMapDiscriminatorStrategy) { disc.setValue(disc.getMappingInfo().getValue(disc, adapt)); break; } } }
public void map(boolean adapt) { // if a superclass maps the discriminator value, so should we. // otherwise assume it's calculated ClassMapping sup = disc.getClassMapping(). getJoinablePCSuperclassMapping(); for (; sup != null; sup = sup.getJoinablePCSuperclassMapping()) { if (sup.getDiscriminator().getValue() != null || sup.getDiscriminator().getStrategy() instanceof ValueMapDiscriminatorStrategy) { disc.setValue(disc.getMappingInfo().getValue(disc, adapt)); break; } } }