Skip to content

Commit

Permalink
added crud for advertisement
Browse files Browse the repository at this point in the history
  • Loading branch information
Troter2 committed Oct 3, 2024
1 parent 96a4c07 commit 1c7e85f
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 15 deletions.
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations-java5</artifactId>
<version>RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies>

<build>
Expand Down
31 changes: 31 additions & 0 deletions src/main/java/cat/udl/eps/softarch/demo/domain/Advertisement.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package cat.udl.eps.softarch.demo.domain;


import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
@Entity
public class Advertisement extends UriEntity<Long> {

// Getters y Setters
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@NotNull
private String title;

@NotNull
private String description;

@NotNull
private Double price;

}
15 changes: 0 additions & 15 deletions src/main/java/cat/udl/eps/softarch/demo/domain/Advertisment.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package cat.udl.eps.softarch.demo.repository;

import cat.udl.eps.softarch.demo.domain.Advertisement;
import org.springframework.data.repository.CrudRepository;

public interface AdvertisementRepository extends CrudRepository<Advertisement, Long> {
}

0 comments on commit 1c7e85f

Please sign in to comment.