BaseEntity
. Used as
- * a base class for objects needing these properties.
- *
- * @author Ken Krebs
- * @author Juergen Hoeller
- */
@MappedSuperclass
public class NamedEntity extends BaseEntity {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
@Column(name = "name")
private String name;
diff --git a/src/main/java/org/springframework/cheapy/model/NuOffer.java b/src/main/java/org/springframework/cheapy/model/NuOffer.java
index 37e665cbd..6b2e6d8e2 100644
--- a/src/main/java/org/springframework/cheapy/model/NuOffer.java
+++ b/src/main/java/org/springframework/cheapy/model/NuOffer.java
@@ -1,19 +1,3 @@
-/*
- * Copyright 2012-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
package org.springframework.cheapy.model;
import javax.persistence.Column;
@@ -28,6 +12,8 @@ import javax.validation.constraints.NotNull;
public class NuOffer extends Offer {
//Oferta por numero de comensales
+ private static final long serialVersionUID = 1L;
+
@NotNull
@Min(1)
private Integer gold;
diff --git a/src/main/java/org/springframework/cheapy/model/Offer.java b/src/main/java/org/springframework/cheapy/model/Offer.java
index 17759487d..c41ca9040 100644
--- a/src/main/java/org/springframework/cheapy/model/Offer.java
+++ b/src/main/java/org/springframework/cheapy/model/Offer.java
@@ -17,22 +17,25 @@ package org.springframework.cheapy.model;
import java.time.LocalDateTime;
-import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
-import javax.persistence.Table;
import javax.validation.constraints.Future;
-import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import org.springframework.format.annotation.DateTimeFormat;
@MappedSuperclass
public class Offer extends BaseEntity {
-//Clase padre
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ //Clase padre
@DateTimeFormat(pattern = "dd/MM/yyyy HH:mm")
@NotNull
@Future
@@ -43,12 +46,13 @@ public class Offer extends BaseEntity {
@Future
private LocalDateTime end;
- @NotBlank
+
private String code;
@Enumerated(value = EnumType.STRING)
private StatusOffer type;
+
@ManyToOne
@JoinColumn(name="client_id")
private Client client;
@@ -84,5 +88,13 @@ public class Offer extends BaseEntity {
public void setType(StatusOffer type) {
this.type = type;
}
+
+ public Client getClient() {
+ return client;
+ }
+
+ public void setClient(Client client) {
+ this.client = client;
+ }
}
diff --git a/src/main/java/org/springframework/cheapy/model/Owner.java b/src/main/java/org/springframework/cheapy/model/Owner.java
index 792f42753..7a04f3434 100644
--- a/src/main/java/org/springframework/cheapy/model/Owner.java
+++ b/src/main/java/org/springframework/cheapy/model/Owner.java
@@ -1,50 +1,22 @@
-/*
- * Copyright 2012-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.springframework.cheapy.model;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
-import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotEmpty;
-import org.springframework.beans.support.MutableSortDefinition;
-import org.springframework.beans.support.PropertyComparator;
import org.springframework.core.style.ToStringCreator;
-/**
- * Simple JavaBean domain object representing an owner.
- *
- * @author Ken Krebs
- * @author Juergen Hoeller
- * @author Sam Brannen
- * @author Michael Isvy
- */
@Entity
@Table(name = "owners")
public class Owner extends Person {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
@Column(name = "address")
@NotEmpty
private String address;
diff --git a/src/main/java/org/springframework/cheapy/model/Person.java b/src/main/java/org/springframework/cheapy/model/Person.java
index 7e8d87c0c..8758455db 100644
--- a/src/main/java/org/springframework/cheapy/model/Person.java
+++ b/src/main/java/org/springframework/cheapy/model/Person.java
@@ -1,32 +1,17 @@
-/*
- * Copyright 2012-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.springframework.cheapy.model;
import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import javax.validation.constraints.NotEmpty;
-/**
- * Simple JavaBean domain object representing an person.
- *
- * @author Ken Krebs
- */
@MappedSuperclass
public class Person extends BaseEntity {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
@Column(name = "first_name")
@NotEmpty
private String firstName;
diff --git a/src/main/java/org/springframework/cheapy/model/SpeedOffer.java b/src/main/java/org/springframework/cheapy/model/SpeedOffer.java
index ca20c296e..7db7a366a 100644
--- a/src/main/java/org/springframework/cheapy/model/SpeedOffer.java
+++ b/src/main/java/org/springframework/cheapy/model/SpeedOffer.java
@@ -1,19 +1,3 @@
-/*
- * Copyright 2012-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
package org.springframework.cheapy.model;
import javax.persistence.Column;
@@ -28,6 +12,8 @@ import javax.validation.constraints.NotNull;
public class SpeedOffer extends Offer {
//Ofertar por rapidez comiendo
+ private static final long serialVersionUID = 1L;
+
@NotNull
@Min(0)
private Integer gold; // x minutos
diff --git a/src/main/java/org/springframework/cheapy/model/TimeOffer.java b/src/main/java/org/springframework/cheapy/model/TimeOffer.java
index ceefc371e..d9833e0c8 100644
--- a/src/main/java/org/springframework/cheapy/model/TimeOffer.java
+++ b/src/main/java/org/springframework/cheapy/model/TimeOffer.java
@@ -1,46 +1,50 @@
-/*
- * Copyright 2012-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.springframework.cheapy.model;
-import java.time.LocalDateTime;
import java.time.LocalTime;
import javax.persistence.Entity;
import javax.persistence.Table;
-import javax.validation.constraints.Future;
import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
import org.springframework.format.annotation.DateTimeFormat;
@Entity
@Table(name = "time_offers")
public class TimeOffer extends Offer {
-//Oferta por franja horaria
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ //Oferta por franja horaria
@DateTimeFormat(pattern = "HH:mm")
- @NotBlank
+ @NotNull
private LocalTime init;
@DateTimeFormat(pattern = "HH:mm")
- @NotBlank
+ @NotNull
private LocalTime finish;
@NotBlank
private String discount;
+ public LocalTime getInit() {
+ return init;
+ }
+ public void setInit(LocalTime init) {
+ this.init = init;
+ }
+
+ public LocalTime getFinish() {
+ return finish;
+ }
+
+ public void setFinish(LocalTime finish) {
+ this.finish = finish;
+ }
public String getDiscount() {
return discount;
diff --git a/src/main/java/org/springframework/cheapy/model/User.java b/src/main/java/org/springframework/cheapy/model/User.java
index 36d495444..bd5b2dd30 100644
--- a/src/main/java/org/springframework/cheapy/model/User.java
+++ b/src/main/java/org/springframework/cheapy/model/User.java
@@ -1,23 +1,13 @@
package org.springframework.cheapy.model;
-import java.util.List;
-import java.util.Set;
-
-import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
-import javax.persistence.MappedSuperclass;
-import javax.persistence.OneToMany;
-import javax.persistence.OneToOne;
import javax.persistence.Table;
-import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotNull;
-
-//@Entity
-//@Table(name = "users")
-@MappedSuperclass
+@Entity
+@Table(name = "users")
+//@MappedSuperclass
public class User{
@Id
@@ -27,7 +17,12 @@ public class User{
private String password;
boolean enabled;
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
public String getUsername() {
@@ -46,11 +41,4 @@ public class User{
this.password = password;
}
-// public SetOwner
domain objects All method names are compliant
- * with Spring Data naming conventions so this interface can easily be extended for Spring
- * Data. See:
- * https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#repositories.query-methods.query-creation
- *
- * @author Ken Krebs
- * @author Juergen Hoeller
- * @author Sam Brannen
- * @author Michael Isvy
- */
public interface FoodOfferRepository extends RepositoryOwner
domain objects All method names are compliant
- * with Spring Data naming conventions so this interface can easily be extended for Spring
- * Data. See:
- * https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#repositories.query-methods.query-creation
- *
- * @author Ken Krebs
- * @author Juergen Hoeller
- * @author Sam Brannen
- * @author Michael Isvy
- */
public interface NuOfferRepository extends RepositoryOwner
domain objects All method names are compliant
- * with Spring Data naming conventions so this interface can easily be extended for Spring
- * Data. See:
- * https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#repositories.query-methods.query-creation
- *
- * @author Ken Krebs
- * @author Juergen Hoeller
- * @author Sam Brannen
- * @author Michael Isvy
- */
public interface SpeedOfferRepository extends RepositoryOwner
domain objects All method names are compliant
- * with Spring Data naming conventions so this interface can easily be extended for Spring
- * Data. See:
- * https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#repositories.query-methods.query-creation
- *
- * @author Ken Krebs
- * @author Juergen Hoeller
- * @author Sam Brannen
- * @author Michael Isvy
- */
public interface TimeOfferRepository extends RepositoryInicio de la oferta | +|
---|---|
Fin de la oferta | +|
Plato en oferta | +|
Descuento | +|
Cantidad | +|
Codigo de la oferta | +
Invalid username or password
+Plato | Fecha inicio | Fecha fin | - +|
---|---|---|---|
- | --%>
|
@@ -36,6 +30,12 @@
|
+
+ |
Fecha inicio | Fecha fin | - +- |
@@ -128,12 +128,12 @@ |
|
- <%--
-
+ | --%>
+ Enlace
+ |
Inicio de la oferta | +|
---|---|
Fin de la oferta | +|
Descuento | +|
Codigo de la oferta | +
- " - class="btn btn-primary btn-block btn-sm">Logout -
+ diff --git a/src/main/webapp/WEB-INF/tags/menuItem.tag b/src/main/webapp/WEB-INF/tags/menuItem.tag index 8c14dbbc5..8b60498f5 100644 --- a/src/main/webapp/WEB-INF/tags/menuItem.tag +++ b/src/main/webapp/WEB-INF/tags/menuItem.tag @@ -1,9 +1,8 @@ <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> - <%@ attribute name="active" required="true" rtexprvalue="true" %> <%@ attribute name="url" required="true" rtexprvalue="true" %> <%@ attribute name="title" required="false" rtexprvalue="true" %> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>