Skip to content

Instantly share code, notes, and snippets.

View xXm4ntr4Xx's full-sized avatar
🎯
Focusing

Pietro Annobil xXm4ntr4Xx

🎯
Focusing
View GitHub Profile
@jahe
jahe / jpa-cheatsheet.java
Last active June 12, 2024 15:11
JPA Cheatsheet
/*
JPA (Java Persistence API)
Transaction Management with an Entity-Mananger:
---
entityManager.getTransaction().begin();
entityManager.persist(<some-entity>);
entityManager.getTransaction().commit();
entityManager.clear();
@jahe
jahe / spring-boot-cheatsheet.java
Last active May 25, 2024 03:47
Spring Boot Cheatsheet
// Enable component-scanning and auto-configuration with @SpringBootApplication Annotation
// It combines @Configuration + @ComponentScan + @EnableAutoConfiguration
@SpringBootApplication
public class FooApplication {
public static void main(String[] args) {
// Bootstrap the application
SpringApplication.run(FooApplication.class, args);
}
}
@Mahkul
Mahkul / Book.java
Created April 9, 2011 11:56
Book class
package database;
public class Book
{
/* at the very beginning we need to create instance variables **/
public String title;
public String author;