-
-
Notifications
You must be signed in to change notification settings - Fork 443
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Add secured implementations for Union SQL Injection --------- Co-authored-by: philipp.delmonego <[email protected]> Co-authored-by: Sebastian Klawin <[email protected]> Co-authored-by: Karan Preet Singh Sasan <[email protected]>
- Loading branch information
1 parent
a867b67
commit 4986733
Showing
4 changed files
with
170 additions
and
11 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,21 @@ | ||
package org.sasanlabs.service.vulnerability.sqlInjection; | ||
|
||
import javax.persistence.*; | ||
|
||
/** @author [email protected] KSASAN */ | ||
@Access(AccessType.FIELD) | ||
@Entity | ||
@Table(name = "cars") | ||
@NamedQuery(name = "findById", query = "select c from CarInformation c where c.id=:id") | ||
public class CarInformation { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private int id; | ||
|
||
private String name; | ||
|
||
@Column(name = "image") | ||
private String imagePath; | ||
|
||
public CarInformation() {} | ||
|
@@ -38,4 +50,8 @@ public String getImagePath() { | |
public void setImagePath(String imagePath) { | ||
this.imagePath = imagePath; | ||
} | ||
|
||
public void setImage(String imagePath) { | ||
this.imagePath = imagePath; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/org/sasanlabs/service/vulnerability/sqlInjection/CarInformationRepository.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.sasanlabs.service.vulnerability.sqlInjection; | ||
|
||
import java.util.Optional; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface CarInformationRepository extends JpaRepository<CarInformation, Integer> { | ||
|
||
Optional<CarInformation> findById(Integer 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
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