Example usage for javax.persistence FlushModeType toString

List of usage examples for javax.persistence FlushModeType toString

Introduction

In this page you can find the example usage for javax.persistence FlushModeType toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:org.apache.openjpa.persistence.EntityManagerImpl.java

/**
 * Translate a flush mode enum value to our internal flush constant.
 *///from  ww  w  . ja  va 2s .co  m
static int toFlushBeforeQueries(FlushModeType flushMode) {
    // choose default for null
    if (flushMode == null)
        return QueryFlushModes.FLUSH_WITH_CONNECTION;
    if (flushMode == FlushModeType.AUTO)
        return QueryFlushModes.FLUSH_TRUE;
    if (flushMode == FlushModeType.COMMIT)
        return QueryFlushModes.FLUSH_FALSE;
    throw new ArgumentException(flushMode.toString(), null, null, false);
}