Java Code Examples for com.gs.fw.common.mithra.finder.RelatedFinder#getAttributeByName()

The following examples show how to use com.gs.fw.common.mithra.finder.RelatedFinder#getAttributeByName() . 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: BusinessDateMilestonedTopLevelLoaderFactory.java    From reladomo with Apache License 2.0 5 votes vote down vote up
protected static Operation getBusinessDateOp(DateCluster dateCluster, RelatedFinder finder)
{
    AsOfAttribute businessDate = (AsOfAttribute) finder.getAttributeByName("businessDate");
    if (dateCluster.hasManyDates())
    {
        Operation fromZOp = businessDate.getFromAttribute().lessThanEquals(dateCluster.getEndDate());
        Operation thruZOp = businessDate.getToAttribute().greaterThan(dateCluster.getStartDate());
        Operation businessDateOp = businessDate.equalsEdgePoint();
        return businessDateOp.and(fromZOp).and(thruZOp);
    }
    else
    {
        return businessDate.eq(dateCluster.getBusinessDate());
    }
}
 
Example 2
Source File: SmallInstrumentIdsOnlyBeforeMilestoneDateAdditionalOperationBuilder.java    From reladomo with Apache License 2.0 5 votes vote down vote up
@Override
public Operation buildOperation(Timestamp businessDate, RelatedFinder relatedFinder)
{
    if (businessDate.before(CUT_OFF_DATE))
    {
        IntegerAttribute instrumentId = (IntegerAttribute) relatedFinder.getAttributeByName("instrumentId");
        return instrumentId.lessThan(3);
    }
    else
    {
        return new None(relatedFinder.getPrimaryKeyAttributes()[0]);
    }
}
 
Example 3
Source File: SmallInstrumentIdsOnlyAdditionalOperationBuilder.java    From reladomo with Apache License 2.0 4 votes vote down vote up
@Override
public Operation buildOperation(Timestamp businessDate, RelatedFinder relatedFinder)
{
    IntegerAttribute instrumentId = (IntegerAttribute) relatedFinder.getAttributeByName("instrumentId");
    return instrumentId.lessThan(3);
}