Java Code Examples for com.gs.fw.common.mithra.MithraObject#zSetNonTxPersistenceState()

The following examples show how to use com.gs.fw.common.mithra.MithraObject#zSetNonTxPersistenceState() . 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: ReladomoDeserializer.java    From reladomo with Apache License 2.0 6 votes vote down vote up
protected void handleNotFoundObject(PartialDeserialized partial, DeserializationClassMetaData metaData) throws DeserializationException
{
    MithraObject inMemory;
    switch (partial.state)
    {
        case 0: // not set
            inMemory = constructObjectAndSetAttributes(partial, metaData);
            partial.setDeserialized(inMemory, ReladomoSerializationContext.IN_MEMORY_STATE);
            break;
        case ReladomoSerializationContext.READ_ONLY_STATE:
        case ReladomoSerializationContext.DETACHED_STATE:
            throw new DeserializationException("Object "+partial.dataObject.zGetPrintablePrimaryKey()+" doesn't exist in the db");
        case ReladomoSerializationContext.DELETED_OR_TERMINATED_STATE:
            inMemory = constructObjectAndSetAttributes(partial, metaData);
            inMemory.zSetNonTxPersistenceState(PersistedState.DELETED);
            partial.setDeserialized(inMemory, ReladomoSerializationContext.DELETED_OR_TERMINATED_STATE);
            break;
        default:
            throw new DeserializationException("should not get here!");
    }
}
 
Example 2
Source File: AbstractNonDatedCache.java    From reladomo with Apache License 2.0 4 votes vote down vote up
protected void markObjectAsDeleted(MithraObject object)
{
    object.zSetNonTxPersistenceState(PersistedState.DELETED);
}