Skip to content

Commit 67085c1

Browse files
authored
Merge pull request #8 from lucapuzzoni/dev
Dev
2 parents 0d35af7 + 7f2a75c commit 67085c1

File tree

2 files changed

+101
-14
lines changed

2 files changed

+101
-14
lines changed

index.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,49 @@ layout: default
66

77

88
<article>
9-
<h2>New WriteUp Aviable</h2>
10-
<p>A new writeup for HackTheBox - Stocker is now aviable. <a href="/pages/writeups/hackthebox/machines/stocker">check it out</a></p>
11-
<small>29 Gen 2023</small>
9+
<h2>New Project Available</h2>
10+
<p>My first github pubblic Project. Read the <a href="{{'/pages/projects/javaGenericCrud'}}">Post</a>.</p>
11+
<small>02 Feb 2023</small>
1212
</article>
1313
<hr>
1414

1515
<article>
16-
<h2>New WriteUp Aviable</h2>
17-
<p>A new writeup for HackTheBox - Precious is now aviable. <a href="/pages/writeups/hackthebox/machines/precious">check it out</a></p>
16+
<h2>New WriteUp Available</h2>
17+
<p>A new writeup for HackTheBox - Stocker is now Available. <a href="{{'/pages/writeups/hackthebox/machines/stocker'}}">check it out</a></p>
1818
<small>29 Gen 2023</small>
1919
</article>
2020
<hr>
2121

2222
<article>
23-
<h2>New WriteUp Aviable</h2>
24-
<p>A new writeup for AngstromCTF 2019 - Paper Bin is now aviable. <a href="/pages/writeups/angstromctf/2019/paperbin">check it out</a></p>
23+
<h2>New WriteUp Available</h2>
24+
<p>A new writeup for HackTheBox - Precious is now Available. <a href="{{'/pages/writeups/hackthebox/machines/precious'}}">check it out</a></p>
2525
<small>29 Gen 2023</small>
2626
</article>
2727
<hr>
2828

2929
<article>
30-
<h2>New WriteUp Aviable</h2>
31-
<p>A new writeup for AngstromCTF 2019 - Paper Trail is now aviable. <a href="/pages/writeups/angstromctf/2019/papertrail">check it out</a></p>
30+
<h2>New WriteUp Available</h2>
31+
<p>A new writeup for AngstromCTF 2019 - Paper Bin is now Available. <a href="{{'/pages/writeups/angstromctf/2019/paperbin'}}">check it out</a></p>
3232
<small>29 Gen 2023</small>
3333
</article>
3434
<hr>
3535

3636
<article>
37-
<h2>New WriteUp Aviable</h2>
38-
<p>A new writeup for AngstromCTF 2019 - LITHP is now aviable. <a href="/pages/writeups/angstromctf/2019/lithp">check it out</a></p>
37+
<h2>New WriteUp Available</h2>
38+
<p>A new writeup for AngstromCTF 2019 - Paper Trail is now Available. <a href="{{'/pages/writeups/angstromctf/2019/papertrail'}}">check it out</a></p>
3939
<small>29 Gen 2023</small>
4040
</article>
4141
<hr>
4242

4343
<article>
44-
<h2>New WriteUp Aviable</h2>
45-
<p>A new writeup for AngstromCTF 2019 - Scratch It Out is now aviable. <a href="/pages/writeups/angstromctf/2019/scratchitout">check it out</a></p>
44+
<h2>New WriteUp Available</h2>
45+
<p>A new writeup for AngstromCTF 2019 - LITHP is now Available. <a href="{{'/pages/writeups/angstromctf/2019/lithp'}}">check it out</a></p>
4646
<small>29 Gen 2023</small>
4747
</article>
48-
<hr>
48+
<hr>
49+
50+
<article>
51+
<h2>New WriteUp Available</h2>
52+
<p>A new writeup for AngstromCTF 2019 - Scratch It Out is now Available. <a href="{{'/pages/writeups/angstromctf/2019/scratchitout'}}">check it out</a></p>
53+
<small>29 Gen 2023</small>
54+
</article>

pages/projects/javaGenericCrud.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
layout: post
3+
author: k0d14k
4+
---
5+
6+
Github : <a href="https://github.com/lucapuzzoni/GenericCRUD">Here</a>
7+
8+
## Configuration istructions
9+
You can use this project to implement automatically your CRUD methods.
10+
11+
You just have to create a **SpringBoot Application project** from [here](https://start.spring.io/) using **Maven** with all the following dependencies:
12+
13+
```xml
14+
15+
<dependency>
16+
<groupId>org.springframework.boot</groupId>
17+
<artifactId>spring-boot-starter-data-jpa</artifactId>
18+
</dependency>
19+
<dependency>
20+
<groupId>org.springframework.boot</groupId>
21+
<artifactId>spring-boot-starter-web</artifactId>
22+
</dependency>
23+
24+
<dependency>
25+
<groupId>com.mysql</groupId>
26+
<artifactId>mysql-connector-j</artifactId>
27+
<scope>runtime</scope>
28+
</dependency>
29+
<dependency>
30+
<groupId>org.projectlombok</groupId>
31+
<artifactId>lombok</artifactId>
32+
<optional>true</optional>
33+
</dependency>
34+
```
35+
36+
And then copy the `it.lucapuzzoni.crud` package in your `src/main/java` directory.
37+
38+
## Usage Istructions
39+
To use my classes you must extend them. With an example it should be clear.
40+
41+
### Entity
42+
```Java
43+
@Entity @Table(name = 'yourTable')
44+
public class YourEntity extends CrudModel<YourEntity>{
45+
// You'll not need to add the @Id field
46+
47+
// Add all columns you want using JPA notations
48+
49+
/**
50+
Remember to implement the absorbe method because is
51+
the method will be called by the update fuction
52+
*/
53+
}
54+
```
55+
56+
### Repository
57+
```Java
58+
@Repository
59+
public interface YourRepository extends CrudRepository<YourEntity>{
60+
// Your Entity should extend CrudModel
61+
}
62+
```
63+
64+
### Service
65+
```Java
66+
@Service
67+
public interface YourService extends CrudService<YourEntity>{}
68+
69+
70+
@Service
71+
public class YourServiceImpl extends CrudServiceImpl<YourEntity>{}
72+
```
73+
74+
### Controller
75+
```Java
76+
@Controller
77+
public class YourController extends CrudController<YourEntity>{}
78+
```
79+
80+
## Conclusions
81+
If you like this project put a Star and Join me to update it otherwise please, explain to me what you didn't like opening an issue and discussing it with me.

0 commit comments

Comments
 (0)