a la hora de arrancar mi proyecto de spring en vscode me dice lo siguiente:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.5.RELEASE)
2019-05-28 11:58:26.250 INFO 12564 --- [ restartedMain] com.crn.tienda.demo.DemoApplication : Starting DemoApplication on DESKTOP-REPNVGL with PID 12564 (C:\Users\Josel\Desktop\TIENDA-SPRING-ANGULAR\BACKEND\tienda\demo\target\classes started by Josel in C:\Users\Josel\Desktop\TIENDA-SPRING-ANGULAR\BACKEND\tienda\demo)
2019-05-28 11:58:26.253 INFO 12564 --- [ restartedMain] com.crn.tienda.demo.DemoApplication : No active profile set, falling back to default profiles: default
2019-05-28 11:58:26.320 INFO 12564 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2019-05-28 11:58:26.320 INFO 12564 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2019-05-28 11:58:27.197 INFO 12564 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
2019-05-28 11:58:27.277 INFO 12564 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 68ms. Found 1 repository interfaces.
2019-05-28 11:58:27.677 INFO 12564 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$4dc17a39] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-05-28 11:58:28.067 INFO 12564 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2019-05-28 11:58:28.098 INFO 12564 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2019-05-28 11:58:28.098 INFO 12564 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.19]
2019-05-28 11:58:28.296 INFO 12564 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2019-05-28 11:58:28.296 INFO 12564 --- [ restartedMain] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1975 ms
2019-05-28 11:58:28.486 INFO 12564 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2019-05-28 11:58:28.670 INFO 12564 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2019-05-28 11:58:28.724 INFO 12564 --- [ restartedMain] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
name: default
...]
2019-05-28 11:58:28.817 INFO 12564 --- [ restartedMain] org.hibernate.Version : HHH000412: Hibernate Core {5.3.10.Final}
2019-05-28 11:58:28.819 INFO 12564 --- [ restartedMain] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
2019-05-28 11:58:29.005 INFO 12564 --- [ restartedMain] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.4.Final}
2019-05-28 11:58:29.168 INFO 12564 --- [ restartedMain] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL57Dialect
2019-05-28 11:58:29.343 WARN 12564 --- [ restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: No identifier specified for entity: com.crn.tienda.demo.entity.Usuario
2019-05-28 11:58:29.344 INFO 12564 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2019-05-28 11:58:29.352 INFO 12564 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
2019-05-28 11:58:29.356 INFO 12564 --- [ restartedMain] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2019-05-28 11:58:29.367 INFO 12564 --- [ restartedMain] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-05-28 11:58:29.373 ERROR 12564 --- [ restartedMain] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: No identifier specified for entity: com.crn.tienda.demo.entity.Usuario
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1778) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
Mi application.properties es :
spring.datasource.url=jdbc:mysql://localhost/db_tienda?useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password=
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.jpa.database-platform=org.hibernate.dialect.MySQL57Dialect
spring.jpa.hibernate.ddl-auto=update
logging.level.org.hibernate.SQL=debug
server.port=8080
Mi entity es Usuario.java
package com.crn.tienda.demo.entity;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.springframework.data.annotation.Id;
/**
* Usuario
*/
@Entity
@Table(name = "usuarios")
public class Usuario implements Serializable{
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "nombre")
private String nombre;
@Column(name = "apellidos")
private String apellidos;
@Column(name = "usuario")
private String usuario;
@Column(name = "email")
private String email;
@Column(name = "passsword")
private String passsword;
@Column(name = "fecha_registro")
@Temporal(TemporalType.DATE)
private Date createAt;
/**
* @return Long return the id
*/
public Long getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Long id) {
this.id = id;
}
/**
* @return String return the nombre
*/
public String getNombre() {
return nombre;
}
/**
* @param nombre the nombre to set
*/
public void setNombre(String nombre) {
this.nombre = nombre;
}
/**
* @return String return the apellidos
*/
public String getApellidos() {
return apellidos;
}
/**
* @param apellidos the apellidos to set
*/
public void setApellidos(String apellidos) {
this.apellidos = apellidos;
}
/**
* @return String return the usuario
*/
public String getUsuario() {
return usuario;
}
/**
* @param usuario the usuario to set
*/
public void setUsuario(String usuario) {
this.usuario = usuario;
}
/**
* @return String return the email
*/
public String getEmail() {
return email;
}
/**
* @param email the email to set
*/
public void setEmail(String email) {
this.email = email;
}
/**
* @return String return the passsword
*/
public String getPasssword() {
return passsword;
}
/**
* @param passsword the passsword to set
*/
public void setPasssword(String passsword) {
this.passsword = passsword;
}
/**
* @return Date return the createAt
*/
public Date getCreateAt() {
return createAt;
}
/**
* @param createAt the createAt to set
*/
public void setCreateAt(Date createAt) {
this.createAt = createAt;
}
}
UsuarioDao.java
package com.crn.tienda.demo.dao;
import com.crn.tienda.demo.entity.Usuario;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
/**
* IUsuarioDao
*/
public interface IUsuarioDao extends CrudRepository<Usuario,Long> {
@Query("select u from Usuario u where u.email = ?1 and u.password = ?2")
Usuario findByEmailandPassword(String email, String password);
@Query("select u from Usuario u where u.usuario = ?1 and u.password = ?2")
Usuario findByUserandPassword(String usuario, String password);
}
IUsuarioService.java
package com.crn.tienda.demo.services;
import java.util.List;
import com.crn.tienda.demo.entity.Usuario;
/**
* IUsuarioService
*/
public interface IUsuarioService {
public List<Usuario> findAll();
}
UsuarioServiceImpl.java
package com.crn.tienda.demo.services;
import java.util.List;
import com.crn.tienda.demo.dao.IUsuarioDao;
import com.crn.tienda.demo.entity.Usuario;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* UsuarioServiceImpl
*/
@Service
public class UsuarioServiceImpl implements IUsuarioService {
@Autowired
private IUsuarioDao usuarioDao;
@Override
@Transactional(readOnly = true)
public List<Usuario> findAll() {
return (List<Usuario>) usuarioDao.findAll();
}
}
Clase main
package com.crn.tienda.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}