Examples of AtomicInsertOperation


Examples of br.com.objectos.comuns.relational.jdbc.Transactions.AtomicInsertOperation

  }

  public void cascaded_insert_shoud_work_as_expected() {
    final String val = "CASC";

    atomicInsert.of(new AtomicInsertOperation() {
      @Override
      public void execute(Insertion insertion) throws SQLException {
        Simple simple = new Simple(val);
        insertion.of(simple);
View Full Code Here

Examples of br.com.objectos.comuns.relational.jdbc.Transactions.AtomicInsertOperation

  public void when_last_fails_first_should_be_rolledbacked() {
    final String firstVal = "FIRST";
    final String secVal = "SEC";

    atomicInsert.of(new AtomicInsertOperation() {
      @Override
      public void execute(Insertion insertion) throws SQLException {
        Simple first = new Simple(firstVal);
        insertion.of(first);

        Other other = new Other(first, "REP");
        insertion.of(other);
      }
    });

    try {
      atomicInsert.of(new AtomicInsertOperation() {
        @Override
        public void execute(Insertion insertion) throws SQLException {
          Simple second = new Simple(secVal);
          insertion.of(second);
View Full Code Here

Examples of br.com.objectos.comuns.relational.jdbc.Transactions.AtomicInsertOperation

  @Override
  public void execute(ListInsertable insertable) {
    final List<Insert> inserts = insertable.getInserts();

    atomicInsert.of(new AtomicInsertOperation() {
      @Override
      public void execute(Insertion insertion) throws SQLException {
        for (Insert insert : inserts) {
          insertion.of(insert);
        }
View Full Code Here

Examples of br.com.objectos.comuns.relational.jdbc.Transactions.AtomicInsertOperation

    execute(operation);
  }

  @Override
  public void of(final Object entity) {
    AtomicInsertOperation operation = new AtomicInsertOperation() {
      @Override
      public void execute(Insertion insertion) throws SQLException {
        Preconditions.checkArgument(entity instanceof Insertable,
            "Entity must be instanceof Insertable.");
        Insertable insertable = (Insertable) entity;
View Full Code Here

Examples of br.com.objectos.comuns.relational.jdbc.Transactions.AtomicInsertOperation

    allOf(iterator);
  }

  @Override
  public void allOf(final Iterator<?> entities) {
    AtomicInsertOperation operation = new AtomicInsertOperation() {
      @Override
      public void execute(Insertion insertion) throws SQLException {

        Iterator<Insertable> iterator = Iterators.transform(entities, new ToInsertable());
View Full Code Here

Examples of br.com.objectos.comuns.relational.jdbc.Transactions.AtomicInsertOperation

    }
  }

  @Override
  public <I extends Insertable> I insert(final I entity) {
    AtomicInsertOperation operation = new AtomicInsertOperation() {
      @Override
      public void execute(Insertion insertion) throws SQLException {
        insertion.of(entity);
      }
    };
View Full Code Here

Examples of br.com.objectos.way.relational.Transactions.AtomicInsertOperation

  }

  public void cascaded_insert_shoud_work_as_expected() {
    final String val = "CASC";

    atomicInsert.of(new AtomicInsertOperation() {
      @Override
      public void execute(Insertion insertion) throws SQLException {
        Simple simple = new Simple(val);
        insertion.of(simple);
View Full Code Here

Examples of br.com.objectos.way.relational.Transactions.AtomicInsertOperation

  public void when_last_fails_first_should_be_rolledbacked() {
    final String firstVal = "FIRST";
    final String secVal = "SEC";

    atomicInsert.of(new AtomicInsertOperation() {
      @Override
      public void execute(Insertion insertion) throws SQLException {
        Simple first = new Simple(firstVal);
        insertion.of(first);

        Other other = new Other(first, "REP");
        insertion.of(other);
      }
    });

    try {
      atomicInsert.of(new AtomicInsertOperation() {
        @Override
        public void execute(Insertion insertion) throws SQLException {
          Simple second = new Simple(secVal);
          insertion.of(second);
View Full Code Here

Examples of br.com.objectos.way.relational.Transactions.AtomicInsertOperation

    allOf(iterator);
  }

  @Override
  public void allOf(final Iterator<?> entities) {
    AtomicInsertOperation operation = new AtomicInsertOperation() {
      @Override
      public void execute(Insertion insertion) throws SQLException {

        Iterator<Insertable> iterator = Iterators.transform(entities, new ToInsertable());
View Full Code Here

Examples of br.com.objectos.way.relational.Transactions.AtomicInsertOperation

    }
  }

  @Override
  public <I extends Insertable> I insert(final I entity) {
    AtomicInsertOperation operation = new AtomicInsertOperation() {
      @Override
      public void execute(Insertion insertion) throws SQLException {
        insertion.of(entity);
      }
    };
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.