/** * Assert that this info has the given strategy or no strategy. */ public void assertStrategy(MetaDataContext context, Object contextStrat, Object expected, boolean die) { if (contextStrat == expected) return; String strat; if (contextStrat == null) { if (_strategy == null) return; if (_strategy.equals(expected.getClass().getName())) return; if (expected instanceof Strategy && _strategy.equals(((Strategy) expected).getAlias())) return; strat = _strategy; } else if (contextStrat instanceof Strategy) strat = ((Strategy) contextStrat).getAlias(); else strat = contextStrat.getClass().getName(); Message msg = _loc.get("unexpected-strategy", context, expected, strat); if (die) throw new MetaDataException(msg); context.getRepository().getLog().warn(msg); }
/** * Assert that this info has the given strategy or no strategy. */ public void assertStrategy(MetaDataContext context, Object contextStrat, Object expected, boolean die) { if (contextStrat == expected) return; String strat; if (contextStrat == null) { if (_strategy == null) return; if (_strategy.equals(expected.getClass().getName())) return; if (expected instanceof Strategy && _strategy.equals(((Strategy) expected).getAlias())) return; strat = _strategy; } else if (contextStrat instanceof Strategy) strat = ((Strategy) contextStrat).getAlias(); else strat = contextStrat.getClass().getName(); Message msg = _loc.get("unexpected-strategy", context, expected, strat); if (die) throw new MetaDataException(msg); context.getRepository().getLog().warn(msg); }
/** * Assert that this info has the given strategy or no strategy. */ public void assertStrategy(MetaDataContext context, Object contextStrat, Object expected, boolean die) { if (contextStrat == expected) return; String strat; if (contextStrat == null) { if (_strategy == null) return; if (_strategy.equals(expected.getClass().getName())) return; if (expected instanceof Strategy && _strategy.equals(((Strategy) expected).getAlias())) return; strat = _strategy; } else if (contextStrat instanceof Strategy) strat = ((Strategy) contextStrat).getAlias(); else strat = contextStrat.getClass().getName(); Message msg = _loc.get("unexpected-strategy", context, expected, strat); if (die) throw new MetaDataException(msg); context.getRepository().getLog().warn(msg); }
/** * Assert that this info has the given strategy or no strategy. */ public void assertStrategy(MetaDataContext context, Object contextStrat, Object expected, boolean die) { if (contextStrat == expected) return; String strat; if (contextStrat == null) { if (_strategy == null) return; if (_strategy.equals(expected.getClass().getName())) return; if (expected instanceof Strategy && _strategy.equals(((Strategy) expected).getAlias())) return; strat = _strategy; } else if (contextStrat instanceof Strategy) strat = ((Strategy) contextStrat).getAlias(); else strat = contextStrat.getClass().getName(); Message msg = _loc.get("unexpected-strategy", context, expected, strat); if (die) throw new MetaDataException(msg); context.getRepository().getLog().warn(msg); }
/** * Assert that this info has the given strategy or no strategy. */ public void assertStrategy(MetaDataContext context, Object contextStrat, Object expected, boolean die) { if (contextStrat == expected) return; String strat; if (contextStrat == null) { if (_strategy == null) return; if (_strategy.equals(expected.getClass().getName())) return; if (expected instanceof Strategy && _strategy.equals(((Strategy) expected).getAlias())) return; strat = _strategy; } else if (contextStrat instanceof Strategy) strat = ((Strategy) contextStrat).getAlias(); else strat = contextStrat.getClass().getName(); Message msg = _loc.get("unexpected-strategy", context, expected, strat); if (die) throw new MetaDataException(msg); context.getRepository().getLog().warn(msg); }
/** * Assert that the user did not try to place an index on this mapping. */ public void assertNoIndex(MetaDataContext context, boolean die) { if (_idx == null) return; Message msg = _loc.get("unexpected-index", context); if (die) throw new MetaDataException(msg); context.getRepository().getLog().warn(msg); }
/** * Assert that the user did not try to place an index on this mapping. */ public void assertNoIndex(MetaDataContext context, boolean die) { if (_idx == null) return; Message msg = _loc.get("unexpected-index", context); if (die) throw new MetaDataException(msg); context.getRepository().getLog().warn(msg); }
/** * Assert that the user did not try to place a unique constraint on this * mapping. */ public void assertNoUnique(MetaDataContext context, boolean die) { if (_unq == null) return; Message msg = _loc.get("unexpected-unique", context); if (die) throw new MetaDataException(msg); context.getRepository().getLog().warn(msg); }
/** * Assert that the user did not try to place a unique constraint on this * mapping. */ public void assertNoUnique(MetaDataContext context, boolean die) { if (_unq == null) return; Message msg = _loc.get("unexpected-unique", context); if (die) throw new MetaDataException(msg); context.getRepository().getLog().warn(msg); }
/** * Assert that the user did not try to join. */ public void assertNoJoin(MetaDataContext context, boolean die) { boolean join = false; if (_cols != null) { Column col; for (int i = 0; !join && i < _cols.size(); i++) { col = (Column) _cols.get(i); if (col.getTarget() != null) join = true; } } if (!join) return; Message msg = _loc.get("unexpected-join", context); if (die) throw new MetaDataException(msg); context.getRepository().getLog().warn(msg); }
/** * Assert that the user did not try to place a unique constraint on this * mapping. */ public void assertNoUnique(MetaDataContext context, boolean die) { if (_unq == null) return; Message msg = _loc.get("unexpected-unique", context); if (die) throw new MetaDataException(msg); context.getRepository().getLog().warn(msg); }
/** * Assert that the user did not try to place a unique constraint on this * mapping. */ public void assertNoUnique(MetaDataContext context, boolean die) { if (_unq == null) return; Message msg = _loc.get("unexpected-unique", context); if (die) throw new MetaDataException(msg); context.getRepository().getLog().warn(msg); }
/** * Assert that the user did not try to place an index on this mapping. */ public void assertNoIndex(MetaDataContext context, boolean die) { if (_idx == null) return; Message msg = _loc.get("unexpected-index", context); if (die) throw new MetaDataException(msg); context.getRepository().getLog().warn(msg); }
/** * Assert that the user did not try to place a unique constraint on this * mapping. */ public void assertNoUnique(MetaDataContext context, boolean die) { if (_unq == null) return; Message msg = _loc.get("unexpected-unique", context); if (die) throw new MetaDataException(msg); context.getRepository().getLog().warn(msg); }
/** * Assert that the user did not try to place an index on this mapping. */ public void assertNoIndex(MetaDataContext context, boolean die) { if (_idx == null) return; Message msg = _loc.get("unexpected-index", context); if (die) throw new MetaDataException(msg); context.getRepository().getLog().warn(msg); }
/** * Assert that the user did not try to place a foreign key on this mapping. */ public void assertNoForeignKey(MetaDataContext context, boolean die) { if (_fk == null) return; Message msg = _loc.get("unexpected-fk", context); if (die) throw new MetaDataException(msg); context.getRepository().getLog().warn(msg); }
/** * Assert that the user did not try to place an index on this mapping. */ public void assertNoIndex(MetaDataContext context, boolean die) { if (_idx == null) return; Message msg = _loc.get("unexpected-index", context); if (die) throw new MetaDataException(msg); context.getRepository().getLog().warn(msg); }
boolean fill = ((MappingRepository) context.getRepository()). getMappingDefaults().defaultMissingInfo(); if ((!given.isEmpty() || (!adapt && !fill))
/** * Assert that the user did not try to join. */ public void assertNoJoin(MetaDataContext context, boolean die) { boolean join = false; if (_cols != null) { Column col; for (int i = 0; !join && i < _cols.size(); i++) { col = (Column) _cols.get(i); if (!DBIdentifier.isNull(col.getTargetIdentifier())) join = true; } } if (!join) return; Message msg = _loc.get("unexpected-join", context); if (die) throw new MetaDataException(msg); context.getRepository().getLog().warn(msg); }
/** * Assert that the user did not try to join. */ public void assertNoJoin(MetaDataContext context, boolean die) { boolean join = false; if (_cols != null) { Column col; for (int i = 0; !join && i < _cols.size(); i++) { col = (Column) _cols.get(i); if (!DBIdentifier.isNull(col.getTargetIdentifier())) join = true; } } if (!join) return; Message msg = _loc.get("unexpected-join", context); if (die) throw new MetaDataException(msg); context.getRepository().getLog().warn(msg); }