Java Code Examples for com.gs.fw.common.mithra.attribute.Attribute#setValueNull()

The following examples show how to use com.gs.fw.common.mithra.attribute.Attribute#setValueNull() . 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: ColumnarInStream.java    From reladomo with Apache License 2.0 6 votes vote down vote up
public BitsInBytes decodeColumnarNull(SingleColumnAttribute attr, List data) throws IOException
{
    int hasNulls = in.read();
    if (hasNulls == 0)
    {
        return null;
    }
    BitsInBytes result = BitsInBytes.readFromInputStream(in, data.size());
    Attribute nullableAttribute = (Attribute) attr;
    for(int i=0;i<data.size();i++)
    {
        if (result.get(i))
        {
            nullableAttribute.setValueNull(data.get(i));
        }
    }
    return result;
}
 
Example 2
Source File: ReladomoDeserializer.java    From reladomo with Apache License 2.0 6 votes vote down vote up
protected void setAttributesAndMethods(MithraObject obj, PartialDeserialized partial, DeserializationClassMetaData metaData)
{
    List<Attribute> settableAttributes = metaData.getSettableAttributes();
    for(int i=0;i<settableAttributes.size();i++)
    {
        Attribute attr = settableAttributes.get(i);
        if (partial.isAttributeSet(attr, metaData))
        {
            Object newValue = attr.valueOf(partial.dataObject);
            if (newValue == null)
            {
                attr.setValueNull(obj);
            }
            else
            {
                attr.setValue(obj, newValue);
            }
        }
    }
    //todo: deserializable methods
}
 
Example 3
Source File: ReladomoDeserializer.java    From reladomo with Apache License 2.0 6 votes vote down vote up
protected boolean arePkAttributesSetWithNullableCheck(DeserializationClassMetaData metaData, Attribute[] pkAttributes, PartialDeserialized partial)
{
    for (Attribute a : pkAttributes)
    {
        if (!partial.isAttributeSet(a, metaData))
        {
            if (a.getMetaData().isNullable())
            {
                a.setValueNull(partial.dataObject);
                partial.markAttributeDone(a, metaData);
            }
            else
            {
                return false;
            }
        }
    }
    return true;
}
 
Example 4
Source File: AbstractTransactionalOperationBasedList.java    From reladomo with Apache License 2.0 5 votes vote down vote up
public void setAttributeNull(DelegatingList<E> delegatingList, Attribute attr)
{
    List resolved = this.resolveOperation(delegatingList);
    for(int i=0;i<resolved.size();i++)
    {
        attr.setValueNull(resolved.get(i));
    }
}