本文整理匯總了Java中org.hibernate.FlushMode.ALWAYS屬性的典型用法代碼示例。如果您正苦於以下問題:Java FlushMode.ALWAYS屬性的具體用法?Java FlushMode.ALWAYS怎麽用?Java FlushMode.ALWAYS使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.hibernate.FlushMode
的用法示例。
在下文中一共展示了FlushMode.ALWAYS屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getFlushMode
private static FlushMode getFlushMode(FlushModeType flushModeType) {
FlushMode flushMode;
switch ( flushModeType ) {
case ALWAYS:
flushMode = FlushMode.ALWAYS;
break;
case AUTO:
flushMode = FlushMode.AUTO;
break;
case COMMIT:
flushMode = FlushMode.COMMIT;
break;
case NEVER:
flushMode = FlushMode.MANUAL;
break;
case MANUAL:
flushMode = FlushMode.MANUAL;
break;
case PERSISTENCE_CONTEXT:
flushMode = null;
break;
default:
throw new AssertionFailure( "Unknown flushModeType: " + flushModeType );
}
return flushMode;
}
示例2: getFlushMode
private static FlushMode getFlushMode(AnnotationInstance[] hints, String element, String query) {
String val = getString( hints, element );
if ( val == null ) {
return null;
}
if ( val.equalsIgnoreCase( FlushMode.ALWAYS.toString() ) ) {
return FlushMode.ALWAYS;
}
else if ( val.equalsIgnoreCase( FlushMode.AUTO.toString() ) ) {
return FlushMode.AUTO;
}
else if ( val.equalsIgnoreCase( FlushMode.COMMIT.toString() ) ) {
return FlushMode.COMMIT;
}
else if ( val.equalsIgnoreCase( FlushMode.NEVER.toString() ) ) {
return FlushMode.MANUAL;
}
else if ( val.equalsIgnoreCase( FlushMode.MANUAL.toString() ) ) {
return FlushMode.MANUAL;
}
else {
throw new AnnotationException( "Unknown FlushMode in hint: " + query + ":" + element );
}
}
示例3: methodWithFlushModeAlwaysAnnotation
@UnitOfWork(
readOnly = false,
cacheMode = CacheMode.NORMAL,
transactional = true,
flushMode = FlushMode.ALWAYS)
public void methodWithFlushModeAlwaysAnnotation() {
}
開發者ID:mtakaki,項目名稱:CredentialStorageService-dw-hibernate,代碼行數:7,代碼來源:UnitOfWorkApplicationListenerTest.java
示例4: flushIsReallyNeeded
private boolean flushIsReallyNeeded(AutoFlushEvent event, final EventSource source) {
return source.getActionQueue()
.areTablesToBeUpdated( event.getQuerySpaces() ) ||
source.getFlushMode()==FlushMode.ALWAYS;
}