Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.hibernate.boot.model.FunctionContributions;
import org.hibernate.boot.model.TypeContributions;
import org.hibernate.community.dialect.identity.GaussDBIdentityColumnSupport;
import org.hibernate.community.dialect.lock.internal.GaussDBLockingSupport;
import org.hibernate.community.dialect.sequence.GaussDBSequenceSupport;
import org.hibernate.dialect.BooleanDecoder;
import org.hibernate.dialect.Dialect;
Expand All @@ -29,6 +30,7 @@
import org.hibernate.dialect.TimeZoneSupport;
import org.hibernate.dialect.aggregate.AggregateSupport;
import org.hibernate.dialect.identity.IdentityColumnSupport;
import org.hibernate.dialect.lock.spi.LockingSupport;
import org.hibernate.dialect.pagination.LimitHandler;
import org.hibernate.dialect.pagination.LimitLimitHandler;
import org.hibernate.dialect.sequence.SequenceSupport;
Expand Down Expand Up @@ -148,6 +150,7 @@
* <a href="https://support.huaweicloud.com/function-gaussdb/index.html">GaussDB documentation</a>.
*
* @author liubao
* @author chen zhida
*
* Notes: Original code of this class is based on PostgreSQLDialect.
*/
Expand Down Expand Up @@ -1121,6 +1124,11 @@ public String getReadLockString(String aliases, int timeout) {
return withTimeout(" for share of " + aliases, timeout );
}

@Override
public LockingSupport getLockingSupport() {
return GaussDBLockingSupport.LOCKING_SUPPORT;
}

@Override
public String getForUpdateNowaitString() {
return supportsNoWait()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* SPDX-License-Identifier: Apache-2.0
* Copyright Red Hat Inc. and Hibernate Authors
*/
package org.hibernate.community.dialect.lock.internal;

import org.hibernate.dialect.RowLockStrategy;
import org.hibernate.dialect.lock.spi.ConnectionLockTimeoutStrategy;
import org.hibernate.dialect.lock.spi.LockingSupport;
import org.hibernate.dialect.lock.spi.OuterJoinLockingType;



/**
* @author chen zhida
*
* Notes: Original code of this class is based on PostgreSQLLockingSupport.
*/
public class GaussDBLockingSupport implements LockingSupport, LockingSupport.Metadata, ConnectionLockTimeoutStrategy {
public static final LockingSupport LOCKING_SUPPORT = new GaussDBLockingSupport();


@Override
public Metadata getMetadata() {
return this;
}

@Override
public RowLockStrategy getWriteRowLockStrategy() {
return RowLockStrategy.TABLE;
}

@Override
public OuterJoinLockingType getOuterJoinLockingType() {
return OuterJoinLockingType.UNSUPPORTED;
}

@Override
public ConnectionLockTimeoutStrategy getConnectionLockTimeoutStrategy() {
return this;
}

@Override
public Level getSupportedLevel() {
return Level.NONE;
}
}
Loading