Example #1
0
 public static void walk(IEntityDefn primary, IEntityDefnParentChildVisitor visitor) {
   try {
     visitor.acceptPrimary(primary);
     visitChildren(primary, visitor);
   } catch (Exception e) {
     throw WrappedException.wrap(e);
   }
 }
Example #2
0
 public static void walk(IEntityDefn entityDefn, IEntityDefnVisitor visitor) {
   try {
     visitor.accept(entityDefn);
     visitChildren(entityDefn, visitor);
   } catch (Exception e) {
     throw WrappedException.wrap(e);
   }
 }
Example #3
0
 public static void walk(IFastOrmContainer fastOrm, IMakerAndEntityDefnVisitor visitor) {
   try {
     IEntityDefn primary = fastOrm.getEntityDefn();
     visitor.acceptPrimary(fastOrm.getPrimaryTempTableMaker(), primary);
     visitChildren(fastOrm, primary, visitor);
   } catch (Exception e) {
     throw WrappedException.wrap(e);
   }
 }
Example #4
0
 public static IEntityDefn parse(ITempTableMakerFactory factory, Resource resource) {
   try {
     XmlToMapParser<String, Object> parser = makeXmlParser();
     String xml = Files.getText(resource);
     Map<String, Object> map = parser.parse(xml);
     return new MapToEntityDefn().create(factory, null, map);
   } catch (Exception e) {
     throw WrappedException.wrap(e);
   }
 }
Example #5
0
 public static void walk(IJob job, IMutableMakerAndEntityDefnVisitor visitor) {
   try {
     IEntityDefn primary = job.getEntityDefn();
     IFastOrmContainer container = job.getContainer();
     visitor.accept(container.getTempTableMakerFactory().findMutatingMakerFor(primary), primary);
     visitChildren(container, primary, visitor);
   } catch (Exception e) {
     throw WrappedException.wrap(e);
   }
 }
Example #6
0
 public static void walkAndTime(
     IFastOrmContainer fastOrm,
     IMakerAndEntityDefnVisitor visitor,
     ICallback<Long> timeCallback) {
   long startTime = System.nanoTime();
   try {
     walk(fastOrm, visitor);
     timeCallback.process(System.nanoTime() - startTime);
   } catch (Exception e) {
     throw WrappedException.wrap(e);
   }
 }
Example #7
0
 public static <From, To> To aggregateAndTime(
     IFastOrmContainer fastOrm,
     IMakerAndEntityDefnFoldVisitor<From, To> visitor,
     IAggregator<From, To> aggregator,
     ICallback<Long> timeCallback) {
   long startTime = System.nanoTime();
   try {
     To result = aggregate(fastOrm, visitor, aggregator);
     timeCallback.process(System.nanoTime() - startTime);
     return result;
   } catch (Exception e) {
     throw WrappedException.wrap(e);
   }
 }