Java Code Examples for javax.persistence.SharedCacheMode#valueOf()

The following examples show how to use javax.persistence.SharedCacheMode#valueOf() . 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: ReloadableEntityManagerFactory.java    From tomee with Apache License 2.0 5 votes vote down vote up
@ManagedOperation
@Description("change the shared cache mode if possible (value is ok)")
public void setSharedCacheMode(final String value) {
    try {
        final String v = value.trim().toUpperCase();
        final SharedCacheMode mode = v.isEmpty() ? SharedCacheMode.UNSPECIFIED : SharedCacheMode.valueOf(v);
        reloadableEntityManagerFactory.setSharedCacheMode(mode);
    } catch (final Exception iae) {
        // ignored
    }
}
 
Example 2
Source File: ParsedPersistenceXmlDescriptor.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public void setSharedCacheMode(String sharedCacheMode) {
	this.sharedCacheMode = SharedCacheMode.valueOf( sharedCacheMode );
}