English 中文(简体)
如何确定违约顺序的生成者分配 规模
原标题:How to set the default sequence generator allocationSize
The bounty expires in 7 days. Answers to this question are eligible for a +50 reputation bounty. user352290 is looking for an answer from a reputable source.

https://docs.oracle.com/javaee%2F6%2Fapi%2F%2F%2F/javax/persistence/SequenceGenerator.html” rel=“nofollow noreferer”>https://docs.oracle.com/javaee%2F6%2Fapi%2F%2F/javax/persistence/SequenceGenerator.html>

BaseIdentifier.java
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(updatable = false, nullable = false)
    private Long id;

Order.java extends BaseIdentifier.java
Purchase.java extends BaseIdentifier.java

如何在<全球的水平上确定所有实体的违约序列生成器-alpositionSize to 1(say Order,cury)

Sample output
Hibernate: 
    create sequence orders_seq start with 1 increment by 50

一、导 言

问题回答

为此:

import jakarta.persistence.*;

@MappedSuperclass
public class BaseIdentifier {

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "custom_gen")
    @SequenceGenerator(name = "custom_gen", allocationSize = 1)
    @Column(updatable = false, nullable = false)
    private Long id;

    // constructor
    // setters and getters.

}

Order_Table:

import jakarta.persistence.Entity;

@Entity
public class Order_Table extends BaseIdentifier {

}

采购:

import jakarta.persistence.Entity;

@Entity
public class Purchase extends BaseIdentifier {

}

Spring Boot logs:

“entergraph

www.un.org/Depts/DGACM/index_spanish.htm 我用Oracle DB进行了检测,并做了工作。

页: 1

“在此处的影像描述”/</a

PURCHASE:

enter image description here

CUSTOM_GEN:

“entergraph





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签