多数据源模拟分布式事务之SpringBoot+Jta-Atomikos+Jpa
0.实体类
package com.example.jta.entity.db1;
import lombok.Data;
import javax.persistence.*;
@Entity
@Table(name = "goods")
@Data
public class Goods {
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
private Long id;
private String name;
}
package com.example.jta.entity.db2;
import lombok.Data;
import lombok.ToString;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@Entity
@Table(name = "user")
@Data
@ToString
pub
共有 0 条评论