Skip to content

Instantly share code, notes, and snippets.

View xXm4ntr4Xx's full-sized avatar
🎯
Focusing

Pietro Annobil xXm4ntr4Xx

🎯
Focusing
View GitHub Profile
@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;
@jahe
jahe / spring-boot-cheatsheet.java
Last active October 8, 2024 00:10
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);
}
}
@jahe
jahe / jpa-cheatsheet.java
Last active October 2, 2024 15:10
JPA Cheatsheet
/*
JPA (Java Persistence API)
Transaction Management with an Entity-Mananger:
---
entityManager.getTransaction().begin();
entityManager.persist(<some-entity>);
entityManager.getTransaction().commit();
entityManager.clear();