com.gs.fw.finder.Operation Java Examples

The following examples show how to use com.gs.fw.finder.Operation. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TestEmbeddedValueObjects.java    From reladomo with Apache License 2.0 6 votes vote down vote up
public void testType2DatedInsert()
    {
        EvoTypesLeaf pk = createEvoTypesLeaf('A', true, (byte) 1, "insert");
        Timestamp businessDate = Timestamp.valueOf("2007-09-10 00:00:00.0");
        Operation op = EvoType2DatedTxnTypesAFinder.pk().eq(pk).and(EvoType2DatedTxnTypesAFinder.businessDate().eq(businessDate));
        assertNull(EvoType2DatedTxnTypesAFinder.findOneBypassCache(op));

        final EvoType2DatedTxnTypes types = new EvoType2DatedTxnTypesA(businessDate);
        types.copyPk(pk);
        MithraManagerProvider.getMithraManager().executeTransactionalCommand(new TransactionalCommand()
        {
            public Object executeTransaction(MithraTransaction tx) throws Throwable
            {
                types.insert();
                return null;
            }
        });

//        assertNotNull(EvoType2DatedTxnTypesAFinder.findOne(op));
        assertNotNull(EvoType2DatedTxnTypesAFinder.findOneBypassCache(op));
    }
 
Example #2
Source File: TestEmbeddedValueObjects.java    From reladomo with Apache License 2.0 6 votes vote down vote up
public void testType1Delete()
{
    Operation op = EvoType1TxnTypesFinder.pk().charAttribute().eq('B').and(EvoType1TxnTypesFinder.pk().booleanAttribute().eq(false));
    final EvoType1TxnTypes types = EvoType1TxnTypesFinder.findOneBypassCache(op);
    assertNotNull(types);

    types.delete();

    assertNull(EvoType1TxnTypesFinder.findOne(op));
    assertNull(EvoType1TxnTypesFinder.findOneBypassCache(op));

    Operation op2 = EvoType1TimeTypesFinder.pk().charAttribute().eq('B').and(EvoType1TimeTypesFinder.pk().timeAttribute().eq(Time.withMillis(1, 25, 30, 0)));
    final EvoType1TimeTypes types2 = EvoType1TimeTypesFinder.findOneBypassCache(op2);
    assertNotNull(types2);

    types2.delete();

    assertNull(EvoType1TimeTypesFinder.findOne(op2));
    assertNull(EvoType1TimeTypesFinder.findOneBypassCache(op2));
}
 
Example #3
Source File: TestEmbeddedValueObjects.java    From reladomo with Apache License 2.0 6 votes vote down vote up
public void testType1DatedUpdateUntil()
{
    final Timestamp businessDate = Timestamp.valueOf("2007-09-10 00:00:00.0");
    final EvoTypesRoot root = this.createEvoTypesRoot('B', false, (byte) 1, "update");
    Operation op = EvoType1DatedTxnTypesFinder.rootEvo().eq(root).and(EvoType1DatedTxnTypesFinder.businessDate().eq(businessDate));
    assertNull(EvoType1DatedTxnTypesFinder.findOneBypassCache(op));

    final EvoType1DatedTxnTypes types = EvoType1DatedTxnTypesFinder.findOneBypassCache(
            EvoType1DatedTxnTypesFinder.pk().charAttribute().eq('B').and(
            EvoType1DatedTxnTypesFinder.pk().booleanAttribute().eq(false)).and(
            EvoType1DatedTxnTypesFinder.businessDate().eq(businessDate)));
    assertNotNull(types);

    final Timestamp newBusinessDateEnd = Timestamp.valueOf("2007-09-12 18:30:00.0");
    MithraManagerProvider.getMithraManager().executeTransactionalCommand(new TransactionalCommand()
    {
        public Object executeTransaction(MithraTransaction tx) throws Throwable
        {
            types.copyRootEvoUntil(root, newBusinessDateEnd);
            return null;
        }
    });

    assertEquals(newBusinessDateEnd, EvoType1DatedTxnTypesFinder.findOne(op).getBusinessDateTo());
    assertEquals(newBusinessDateEnd, EvoType1DatedTxnTypesFinder.findOneBypassCache(op).getBusinessDateTo());
}
 
Example #4
Source File: TestEmbeddedValueObjects.java    From reladomo with Apache License 2.0 6 votes vote down vote up
public void testType3MultiUpdate()
{
    final EvoTypesRoot root = this.createEvoTypesRoot('A', false, (byte) 1, "multi");
    Operation op = EvoType3TxnTypesAFinder.rootEvo().eq(root);
    assertEquals(0, EvoType3TxnTypesAFinder.findMany(op).size());
    final EvoType3TxnTypesAList typesList = EvoType3TxnTypesAFinder.findMany(EvoType3TxnTypesAFinder.all());
    assertEquals(2, typesList.size());

    MithraManagerProvider.getMithraManager().executeTransactionalCommand(new TransactionalCommand()
    {
        public Object executeTransaction(MithraTransaction tx) throws Throwable
        {
            for (EvoType3TxnTypesA types : typesList)
            {
                types.copyRootEvo(root);
            }
            return null;
        }
    });

    assertEquals(2, EvoType3TxnTypesAFinder.findMany(op).size());
    assertEquals(2, EvoType3TxnTypesAFinder.findManyBypassCache(op).size());
}
 
Example #5
Source File: TestEmbeddedValueObjects.java    From reladomo with Apache License 2.0 6 votes vote down vote up
public void testType2BatchInsert()
{
    Operation op = EvoType2TxnTypesBFinder.pk().stringAttribute().eq("batch");
    assertEquals(0, EvoType2TxnTypesBFinder.findMany(op).size());

    final EvoType2TxnTypesBList typesList = new EvoType2TxnTypesBList();
    for (int i = 0; i < 10; i++)
    {
        EvoTypesLeaf typesPk = createEvoTypesLeaf('B', true, (byte) i, "batch");
        EvoType2TxnTypesB types = new EvoType2TxnTypesB();
        types.copyPk(typesPk);
        typesList.add(types);
    }
    typesList.insertAll();

    assertEquals(10, EvoType2TxnTypesBFinder.findMany(op).size());
    assertEquals(10, EvoType2TxnTypesBFinder.findManyBypassCache(op).size());
}
 
Example #6
Source File: TestEmbeddedValueObjects.java    From reladomo with Apache License 2.0 6 votes vote down vote up
public void testType2BatchUpdate()
{
    final EvoTypesRoot root = this.createEvoTypesRoot('A', false, (byte) 1, "batch");
    Operation op = EvoType2TxnTypesAFinder.rootEvo().eq(root);
    assertEquals(0, EvoType2TxnTypesAFinder.findMany(op).size());
    final EvoType2TxnTypesAList typesList = EvoType2TxnTypesAFinder.findMany(EvoType2TxnTypesAFinder.all());
    assertEquals(2, typesList.size());

    MithraManagerProvider.getMithraManager().executeTransactionalCommand(new TransactionalCommand()
    {
        public Object executeTransaction(MithraTransaction tx) throws Throwable
        {
            typesList.copyRootEvo(root);
            return null;
        }
    });

    assertEquals(2, EvoType2TxnTypesAFinder.findMany(op).size());
    assertEquals(2, EvoType2TxnTypesAFinder.findManyBypassCache(op).size());
}
 
Example #7
Source File: TestEmbeddedValueObjects.java    From reladomo with Apache License 2.0 6 votes vote down vote up
public void testType1Insert()
    {
        EvoTypesLeaf pk = createEvoTypesLeaf('A', true, (byte) 1, "insert");
        Operation op = EvoType1TxnTypesFinder.pk().eq(pk);
        assertNull(EvoType1TxnTypesFinder.findOneBypassCache(op));

        final EvoType1TxnTypes types = new EvoType1TxnTypes();
        types.copyPk(pk);
        types.insert();

        EvoType1TxnTypesFinder.clearQueryCache();
        //TODO: ledav fix date matching in full cache
//        assertNotNull(EvoType1TxnTypesFinder.findOne(op));
        assertNotNull(EvoType1TxnTypesFinder.findOneBypassCache(op));

        EvoTypesTime pk2 = createEvoTypesTime('A', true, (byte) 1, "insert", Time.withMillis(1, 1, 1, 1));
        Operation op2 = EvoType1TimeTypesFinder.pk().eq(pk2);
        assertNull(EvoType1TimeTypesFinder.findOneBypassCache(op2));

        final EvoType1TimeTypes types2 = new EvoType1TimeTypes();
        types2.copyPk(pk2);
        types2.insert();

        EvoType1TimeTypesFinder.clearQueryCache();
        assertNotNull(EvoType1TimeTypesFinder.findOneBypassCache(op2));
    }
 
Example #8
Source File: TestEmbeddedValueObjects.java    From reladomo with Apache License 2.0 6 votes vote down vote up
public void testType3BatchUpdate()
{
    final EvoTypesRoot root = this.createEvoTypesRoot('A', false, (byte) 1, "batch");
    Operation op = EvoType3TxnTypesAFinder.rootEvo().eq(root);
    assertEquals(0, EvoType3TxnTypesAFinder.findMany(op).size());
    final EvoType3TxnTypesAList typesList = EvoType3TxnTypesAFinder.findMany(EvoType3TxnTypesAFinder.all());
    assertEquals(2, typesList.size());

    MithraManagerProvider.getMithraManager().executeTransactionalCommand(new TransactionalCommand()
    {
        public Object executeTransaction(MithraTransaction tx) throws Throwable
        {
            typesList.copyRootEvo(root);
            return null;
        }
    });

    assertEquals(2, EvoType3TxnTypesAFinder.findMany(op).size());
    assertEquals(2, EvoType3TxnTypesAFinder.findManyBypassCache(op).size());
}
 
Example #9
Source File: TestEmbeddedValueObjects.java    From reladomo with Apache License 2.0 5 votes vote down vote up
public void testType3FindOne()
{
    Operation op1 = EvoType3ReadOnlyTypesAFinder.pk().charAttribute().eq('A').and(EvoType3ReadOnlyTypesAFinder.pk().booleanAttribute().eq(true));
    assertNotNull(EvoType3ReadOnlyTypesAFinder.findOne(op1));
    assertNotNull(EvoType3ReadOnlyTypesAFinder.findOneBypassCache(op1));

    Operation op2 = EvoType3TxnTypesBFinder.pk().charAttribute().eq('B').and(EvoType3TxnTypesBFinder.pk().booleanAttribute().eq(false));
    assertNotNull(EvoType3TxnTypesBFinder.findOne(op2));
    assertNotNull(EvoType3TxnTypesBFinder.findOneBypassCache(op2));
}
 
Example #10
Source File: TestEmbeddedValueObjects.java    From reladomo with Apache License 2.0 5 votes vote down vote up
public void testType2DatedFindAll()
{
    Operation op1 = EvoType2DatedReadOnlyTypesAFinder.businessDate().eq(Timestamp.valueOf("2007-09-10 00:00:00.0")).and(
        EvoType2DatedReadOnlyTypesAFinder.processingDate().eq(Timestamp.valueOf("2007-10-15 00:00:00.0")));
    assertEquals(2, EvoType2DatedReadOnlyTypesAFinder.findMany(op1).size());
    assertEquals(2, EvoType2DatedReadOnlyTypesAFinder.findManyBypassCache(op1).size());

    Operation op2 = EvoType2DatedTxnTypesBFinder.businessDate().eq(Timestamp.valueOf("2007-09-10 00:00:00.0")).and(
        EvoType2DatedTxnTypesBFinder.processingDate().eq(Timestamp.valueOf("2007-10-15 00:00:00.0")));
    assertEquals(2, EvoType2DatedTxnTypesBFinder.findMany(op2).size());
    assertEquals(2, EvoType2DatedTxnTypesBFinder.findManyBypassCache(op2).size());
}
 
Example #11
Source File: TestEmbeddedValueObjects.java    From reladomo with Apache License 2.0 5 votes vote down vote up
public void testType1DatedIncrement()
{
    final BigDecimal value1= new BigDecimal("144444444444444.444");
    final BigDecimal value2= new BigDecimal("244444444444444.444");
    final BigDecimal value3= new BigDecimal("34444444.44");
    Operation op = EvoType1DatedTxnTypesFinder.pk().charAttribute().eq('B').and(
        EvoType1DatedTxnTypesFinder.pk().booleanAttribute().eq(false)).and(
        EvoType1DatedTxnTypesFinder.businessDate().eq(Timestamp.valueOf("2007-09-10 00:00:00.0")));

    final EvoType1DatedTxnTypes types = EvoType1DatedTxnTypesFinder.findOneBypassCache(op);
    assertEquals(1.1d, types.getRootEvo().getDoubleAttribute());
    assertEquals(value1, types.getRootEvo().getBigDecimalAttribute());
    assertEquals(value2, types.getRootEvo().getNestedEvo().getBigDecimalAttribute());
    assertEquals(value3, types.getRootEvo().getNestedEvo().getLeafEvo().getBigDecimalAttribute());

    MithraManagerProvider.getMithraManager().executeTransactionalCommand(new TransactionalCommand()
    {
        public Object executeTransaction(MithraTransaction tx) throws Throwable
        {
            types.getRootEvo().incrementDoubleAttribute(6.0d);
            types.getRootEvo().incrementBigDecimalAttribute(value1);
            types.getRootEvo().getNestedEvo().incrementBigDecimalAttribute(value2);
            types.getRootEvo().getNestedEvo().getLeafEvo().incrementBigDecimalAttribute(value3);
            return null;
        }
    });

    BigDecimal incrementedValue1 = new BigDecimal("288888888888888.888");
    BigDecimal incrementedValue2 = new BigDecimal("488888888888888.888");
    BigDecimal incrementedValue3 = new BigDecimal("68888888.88");
    assertEquals(7.1d, EvoType1DatedTxnTypesFinder.findOne(op).getRootEvo().getDoubleAttribute());
    assertEquals(7.1d, EvoType1DatedTxnTypesFinder.findOneBypassCache(op).getRootEvo().getDoubleAttribute());

    assertEquals(incrementedValue1, EvoType1DatedTxnTypesFinder.findOne(op).getRootEvo().getBigDecimalAttribute());
    assertEquals(incrementedValue1, EvoType1DatedTxnTypesFinder.findOneBypassCache(op).getRootEvo().getBigDecimalAttribute());
    assertEquals(incrementedValue2, EvoType1DatedTxnTypesFinder.findOne(op).getRootEvo().getNestedEvo().getBigDecimalAttribute());
    assertEquals(incrementedValue2, EvoType1DatedTxnTypesFinder.findOneBypassCache(op).getRootEvo().getNestedEvo().getBigDecimalAttribute());
    assertEquals(incrementedValue3, EvoType1DatedTxnTypesFinder.findOne(op).getRootEvo().getNestedEvo().getLeafEvo().getBigDecimalAttribute());
    assertEquals(incrementedValue3, EvoType1DatedTxnTypesFinder.findOneBypassCache(op).getRootEvo().getNestedEvo().getLeafEvo().getBigDecimalAttribute());
}
 
Example #12
Source File: TestEmbeddedValueObjects.java    From reladomo with Apache License 2.0 5 votes vote down vote up
public void testType2DatedFindOne()
{
    Operation op1 = EvoType2DatedReadOnlyTypesAFinder.pk().booleanAttribute().eq(true).and(
        EvoType2DatedReadOnlyTypesAFinder.businessDate().eq(Timestamp.valueOf("2007-09-10 00:00:00.0")).and(
        EvoType2DatedReadOnlyTypesAFinder.processingDate().eq(Timestamp.valueOf("2007-10-15 00:00:00.0"))));
    assertEquals(150, EvoType2DatedReadOnlyTypesAFinder.findOne(op1).getRootEvo().getIntAttribute());
    assertEquals(150, EvoType2DatedReadOnlyTypesAFinder.findOneBypassCache(op1).getRootEvo().getIntAttribute());

    Operation op2 = EvoType2DatedTxnTypesBFinder.pk().booleanAttribute().eq(true).and(
        EvoType2DatedTxnTypesBFinder.businessDate().eq(Timestamp.valueOf("2007-09-10 00:00:00.0")).and(
        EvoType2DatedTxnTypesBFinder.processingDate().eq(Timestamp.valueOf("2007-09-22 00:00:00.0"))));
    assertEquals(100, EvoType2DatedTxnTypesBFinder.findOne(op2).getRootEvo().getIntAttribute());
    assertEquals(100, EvoType2DatedTxnTypesBFinder.findOneBypassCache(op2).getRootEvo().getIntAttribute());
}
 
Example #13
Source File: TestEmbeddedValueObjects.java    From reladomo with Apache License 2.0 5 votes vote down vote up
public void testType1DatedFindAll()
{
    Operation op1 = EvoType1DatedReadOnlyTypesFinder.businessDate().eq(Timestamp.valueOf("2007-09-10 00:00:00.0")).and(
        EvoType1DatedReadOnlyTypesFinder.processingDate().eq(Timestamp.valueOf("2007-10-15 00:00:00.0")));
    assertEquals(4, EvoType1DatedReadOnlyTypesFinder.findMany(op1).size());
    assertEquals(4, EvoType1DatedReadOnlyTypesFinder.findManyBypassCache(op1).size());

    Operation op2 = EvoType1DatedTxnTypesFinder.businessDate().eq(Timestamp.valueOf("2007-09-10 00:00:00.0")).and(
        EvoType1DatedTxnTypesFinder.processingDate().eq(Timestamp.valueOf("2007-10-15 00:00:00.0")));
    assertEquals(4, EvoType1DatedTxnTypesFinder.findMany(op2).size());
    assertEquals(4, EvoType1DatedTxnTypesFinder.findManyBypassCache(op2).size());
}
 
Example #14
Source File: Cellphone2List.java    From reladomo with Apache License 2.0 4 votes vote down vote up
public Cellphone2List(Operation operation)
{
	super(operation);
}
 
Example #15
Source File: AbstractChildList.java    From reladomo with Apache License 2.0 4 votes vote down vote up
public AbstractChildList(Operation operation)
{
	super(operation);
}
 
Example #16
Source File: AlarmBitemporalTransactionalList.java    From reladomo with Apache License 2.0 4 votes vote down vote up
public AlarmBitemporalTransactionalList(Operation operation)
{
	super(operation);
}
 
Example #17
Source File: SaleAggregateDataList.java    From reladomo with Apache License 2.0 4 votes vote down vote up
public SaleAggregateDataList(Operation operation)
{
	super(operation);
}
 
Example #18
Source File: PositionDriverList.java    From reladomo with Apache License 2.0 4 votes vote down vote up
public PositionDriverList(Operation operation)
{
	super(operation);
}
 
Example #19
Source File: MagReportingAttributesList.java    From reladomo with Apache License 2.0 4 votes vote down vote up
public MagReportingAttributesList(Operation operation)
{
	super(operation);
}
 
Example #20
Source File: AccountBalanceList.java    From reladomo-kata with Apache License 2.0 4 votes vote down vote up
public AccountBalanceList(Operation operation)
{
	super(operation);
}
 
Example #21
Source File: DatedAllTypesNullList.java    From reladomo with Apache License 2.0 4 votes vote down vote up
public DatedAllTypesNullList(Operation operation)
{
    super(operation);
}
 
Example #22
Source File: BitemporalBigOrderList.java    From reladomo with Apache License 2.0 4 votes vote down vote up
public BitemporalBigOrderList(Operation operation)
{
	super(operation);
}
 
Example #23
Source File: PhProductSynonymList.java    From reladomo with Apache License 2.0 4 votes vote down vote up
public PhProductSynonymList(Operation operation)
{
	super(operation);
}
 
Example #24
Source File: ConcreteChildList.java    From reladomo with Apache License 2.0 4 votes vote down vote up
public ConcreteChildList(Operation operation)
{
	super(operation);
}
 
Example #25
Source File: OrderWithMissingColumnList.java    From reladomo with Apache License 2.0 4 votes vote down vote up
public OrderWithMissingColumnList(Operation operation)
{
	super(operation);
}
 
Example #26
Source File: AuditedOrderStatusWithNonDatedOrderList.java    From reladomo with Apache License 2.0 4 votes vote down vote up
public AuditedOrderStatusWithNonDatedOrderList(Operation operation)
{
	super(operation);
}
 
Example #27
Source File: ProductCategoryList.java    From reladomo with Apache License 2.0 4 votes vote down vote up
public ProductCategoryList(Operation operation)
{
	super(operation);
}
 
Example #28
Source File: CustomerAccountList.java    From reladomo-kata with Apache License 2.0 4 votes vote down vote up
public CustomerAccountList(Operation operation)
{
    super(operation);
}
 
Example #29
Source File: AlarmCategoryList.java    From reladomo with Apache License 2.0 4 votes vote down vote up
public AlarmCategoryList(Operation operation)
{
	super(operation);
}
 
Example #30
Source File: BcpSimpleWithIdentityList.java    From reladomo with Apache License 2.0 4 votes vote down vote up
public BcpSimpleWithIdentityList(Operation operation)
{
	super(operation);
}