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
export async function transactionWithRetry<T>( | |
manager: EntityManager, | |
runInTx: (tx: QueryRunner) => Promise<T>, | |
options: TxOptions = { retries: 10 }, | |
) { | |
const maxRetries = options.retries; | |
const backoffInterval = 100; | |
let tries = 1; | |
while (tries <= maxRetries) { |
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
const User = require('./db/user'); | |
const interface = { | |
find(id) {}, | |
update(id, data) {} | |
} | |
// index.js or main.js | |
// const userRoute = requrie('./routes/users'); |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
</head> | |
<style> | |
.introduction { |
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
package com.example.demo; | |
import javax.persistence.*; | |
import java.util.List; | |
@Entity | |
@Table(name = "customers") | |
public class Customer { | |
@Id | |
int id; |
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
package com.example.demo; | |
import javax.persistence.*; | |
import java.util.List; | |
@Entity | |
@Table(name = "orders") | |
public class Order { | |
@Id | |
int id; | |
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
package com.example.demo; | |
import javax.persistence.*; | |
@Entity | |
@Table(name = "order_line_items") | |
public class OrderLineItem { | |
@Id | |
int id; | |
@Column(name = "book_id") |
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
package com.example.demo; | |
import javax.persistence.*; | |
@Entity | |
@Table(name = "orders") | |
public class Order { | |
@Id | |
int id; | |
public Order() { |
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
package com.example.demo; | |
import javax.persistence.*; | |
@Entity | |
@Table(name = "customers") | |
public class Customer { | |
@Id | |
int id; | |
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
import org.springframework.data.jpa.repository.JpaRepository; | |
import org.springframework.stereotype.Repository; | |
@Repository | |
public interface BookRepository extends JpaRepository<Book, int> {} |
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
package com.example.demo; | |
import javax.persistence.*; | |
@Entity | |
@Table(name = "books") | |
public class Book { | |
@Id | |
int id; | |
public Book() { |
NewerOlder