Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HHH-13135 Use FOR NO KEY UPDATE when locking in PostgreSQL
- Loading branch information
Showing
3 changed files
with
152 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
hibernate-core/src/test/java/org/hibernate/orm/test/jpa/lock/LockReference.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Hibernate, Relational Persistence for Idiomatic Java | ||
* | ||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later. | ||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. | ||
*/ | ||
|
||
//$Id$ | ||
package org.hibernate.orm.test.jpa.lock; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.LockModeType; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.persistence.NamedQuery; | ||
import jakarta.persistence.QueryHint; | ||
import jakarta.persistence.Version; | ||
|
||
/** | ||
* @author Emmanuel Bernard | ||
*/ | ||
@Entity | ||
public class LockReference { | ||
private Integer id; | ||
private String name; | ||
private Lock lock; | ||
|
||
public LockReference() { | ||
} | ||
|
||
public LockReference(Integer id, String name) { | ||
this.id = id; | ||
this.name = name; | ||
} | ||
|
||
@Id | ||
public Integer getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Integer id) { | ||
this.id = id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
@ManyToOne | ||
public Lock getLock() { | ||
return lock; | ||
} | ||
|
||
public void setLock(Lock lock) { | ||
this.lock = lock; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters