Prezados, bom dia.
Estou refazendo o curso de Java e JPA: Otimizações com JPA2 e Hibernate, porém quando subo a aplicação, todos os dados são inseridos novamente. Eu vi que tem uma classe ConfiguradorDeProduto, aonde a mesma inclui já alguns produtos, eu comentei a classe toda e os produtos continuam a ser inseridos.
Properties props = new Properties();
props.setProperty("hibernate.dialect", "org.hibernate.dialect.MySQL5InnoDBDialect");
props.setProperty("hibernate.show_sql", "true");
props.setProperty("hibernate.hbm2ddl.auto", "upadate");
props.setProperty("hibernate.cache.use_second_level_cache", "true");
props.setProperty("hibernate.cache.use_query_cache", "true");
props.setProperty("hibernate.generate_statistics", "true");
props.setProperty("hibernate.cache.region.factory_class", "org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory");
dados do meu console
jul 08, 2017 10:22:57 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
ADVERTÊNCIA: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:projeto-jpa-2' did not find a matching property.
jul 08, 2017 10:22:57 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Server version: Apache Tomcat/8.5.15
jul 08, 2017 10:22:57 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Server built: May 5 2017 11:03:04 UTC
jul 08, 2017 10:22:57 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Server number: 8.5.15.0
jul 08, 2017 10:22:57 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: OS Name: Windows 10
jul 08, 2017 10:22:57 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: OS Version: 10.0
jul 08, 2017 10:22:57 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Architecture: amd64
jul 08, 2017 10:22:57 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Java Home: C:\Program Files\Java\jre1.8.0_131
jul 08, 2017 10:22:57 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: JVM Version: 1.8.0_131-b11
jul 08, 2017 10:22:57 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: JVM Vendor: Oracle Corporation
jul 08, 2017 10:22:57 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: CATALINA_BASE: C:\Users\Junior\Desktop\workspace2\.metadata\.plugins\org.eclipse.wst.server.core\tmp1
jul 08, 2017 10:22:57 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: CATALINA_HOME: C:\apache-tomcat-8.5.15-windows-x64\apache-tomcat-8.5.15
jul 08, 2017 10:22:57 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Dcatalina.base=C:\Users\Junior\Desktop\workspace2\.metadata\.plugins\org.eclipse.wst.server.core\tmp1
jul 08, 2017 10:22:57 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Dcatalina.home=C:\apache-tomcat-8.5.15-windows-x64\apache-tomcat-8.5.15
jul 08, 2017 10:22:57 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Dwtp.deploy=C:\Users\Junior\Desktop\workspace2\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps
jul 08, 2017 10:22:57 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Djava.endorsed.dirs=C:\apache-tomcat-8.5.15-windows-x64\apache-tomcat-8.5.15\endorsed
jul 08, 2017 10:22:57 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Dfile.encoding=ISO-8859-1
jul 08, 2017 10:22:57 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFORMAÇÕES: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jre1.8.0_131\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre1.8.0_131/bin/server;C:/Program Files/Java/jre1.8.0_131/bin;C:/Program Files/Java/jre1.8.0_131/lib/amd64;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;%JAVA_HOME%\bin;C:\Program Files\Git\cmd;C:\Program Files (x86)\Skype\Phone\;C:\Users\Junior\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Git\cmd;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;%JAVA_HOME%\bin;C:\Program Files\Git\cmd;C:\Program Files (x86)\Skype\Phone\;;C:\Program Files\Java\jdk1.8.0_111\bin;C:\grails-3.2.3\bin;C:\apache-maven-3.5.0-bin\apache-maven-3.5.0\bin;;C:\Users\Junior\Desktop\eclipse-jee-neon\eclipse;;.]
jul 08, 2017 10:22:57 AM org.apache.coyote.AbstractProtocol init
INFORMAÇÕES: Initializing ProtocolHandler ["http-nio-8090"]
jul 08, 2017 10:22:58 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFORMAÇÕES: Using a shared selector for servlet write/read
jul 08, 2017 10:22:58 AM org.apache.coyote.AbstractProtocol init
INFORMAÇÕES: Initializing ProtocolHandler ["ajp-nio-8009"]
jul 08, 2017 10:22:58 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFORMAÇÕES: Using a shared selector for servlet write/read
jul 08, 2017 10:22:58 AM org.apache.catalina.startup.Catalina load
INFORMAÇÕES: Initialization processed in 837 ms
jul 08, 2017 10:22:58 AM org.apache.catalina.core.StandardService startInternal
INFORMAÇÕES: Starting service [Catalina]
jul 08, 2017 10:22:58 AM org.apache.catalina.core.StandardEngine startInternal
INFORMAÇÕES: Starting Servlet Engine: Apache Tomcat/8.5.15
jul 08, 2017 10:23:00 AM org.apache.jasper.servlet.TldScanner scanJars
INFORMAÇÕES: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
jul 08, 2017 10:23:00 AM org.apache.catalina.core.ApplicationContext log
INFORMAÇÕES: Spring WebApplicationInitializers detected on classpath: [br.com.caelum.Inicializador@3adfc1ce]
jul 08, 2017 10:23:00 AM org.apache.catalina.core.ApplicationContext log
INFORMAÇÕES: Initializing Spring root WebApplicationContext
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
[localhost-startStop-1] WARN net.sf.ehcache.config.ConfigurationFactory - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/C:/Users/Junior/Desktop/workspace2/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/projeto-jpa-2/WEB-INF/lib/ehcache-core-2.4.3.jar!/ehcache-failsafe.xml
[net.sf.ehcache.CacheManager@94238d] INFO net.sf.ehcache.util.UpdateChecker - New update(s) found: 2.4.7 [http://www.terracotta.org/confluence/display/release/Release+Notes+Ehcache+Core+2.4]. Please check http://ehcache.org for the latest version.
Hibernate: insert into Loja (nome) values (?)
Hibernate: insert into Loja (nome) values (?)
Hibernate: insert into Categoria (nome) values (?)
Hibernate: insert into Categoria (nome) values (?)
Hibernate: insert into Produto (descricao, linkDaFoto, loja_id, nome, preco, versao) values (?, ?, ?, ?, ?, ?)
Hibernate: insert into Produto (descricao, linkDaFoto, loja_id, nome, preco, versao) values (?, ?, ?, ?, ?, ?)
Hibernate: insert into Produto (descricao, linkDaFoto, loja_id, nome, preco, versao) values (?, ?, ?, ?, ?, ?)
Hibernate: insert into Produto (descricao, linkDaFoto, loja_id, nome, preco, versao) values (?, ?, ?, ?, ?, ?)
Hibernate: insert into Produto (descricao, linkDaFoto, loja_id, nome, preco, versao) values (?, ?, ?, ?, ?, ?)
Hibernate: insert into Produto_Categoria (Produto_id, categorias_id) values (?, ?)
Hibernate: insert into Produto_Categoria (Produto_id, categorias_id) values (?, ?)
Hibernate: insert into Produto_Categoria (Produto_id, categorias_id) values (?, ?)
Hibernate: insert into Produto_Categoria (Produto_id, categorias_id) values (?, ?)
Hibernate: insert into Produto_Categoria (Produto_id, categorias_id) values (?, ?)
Hibernate: insert into Produto_Categoria (Produto_id, categorias_id) values (?, ?)
Hibernate: select loja0_.id as id1_1_, loja0_.nome as nome2_1_ from Loja loja0_
Hibernate: select categoria0_.id as id1_0_, categoria0_.nome as nome2_0_ from Categoria categoria0_
jul 08, 2017 10:23:06 AM org.apache.catalina.core.ApplicationContext log
INFORMAÇÕES: Set web app root system property: 'webapp.root' = [C:\Users\Junior\Desktop\workspace2\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\projeto-jpa-2\]
jul 08, 2017 10:23:06 AM org.apache.catalina.core.ApplicationContext log
INFORMAÇÕES: Initializing log4j from [C:\Users\Junior\Desktop\workspace2\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\projeto-jpa-2\WEB-INF\log4j.xml]
log4j: Threshold ="null".
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [org.springframework] additivity to [true].
log4j: Level value for org.springframework is [warn].
log4j: org.springframework level set to WARN
log4j: Class name: [org.apache.log4j.ConsoleAppender]
log4j: Setting property [threshold] to [DEBUG].
log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
log4j: Setting property [conversionPattern] to [%d{HH:mm:ss} %p [%t]:%c{3}.%M()%L - %m%n].
log4j: Adding appender named [stdout] to category [org.springframework].
jul 08, 2017 10:23:06 AM org.apache.catalina.core.ApplicationContext log
INFORMAÇÕES: Initializing Spring FrameworkServlet 'dispatcher'
jul 08, 2017 10:23:06 AM org.apache.coyote.AbstractProtocol start
INFORMAÇÕES: Starting ProtocolHandler ["http-nio-8090"]
jul 08, 2017 10:23:06 AM org.apache.coyote.AbstractProtocol start
INFORMAÇÕES: Starting ProtocolHandler ["ajp-nio-8009"]
jul 08, 2017 10:23:06 AM org.apache.catalina.startup.Catalina start
INFORMAÇÕES: Server startup in 8372 ms
Hibernate: select produto0_.id as id1_2_, produto0_.descricao as descrica2_2_, produto0_.linkDaFoto as linkDaFo3_2_, produto0_.loja_id as loja_id7_2_, produto0_.nome as nome4_2_, produto0_.preco as preco5_2_, produto0_.versao as versao6_2_ from Produto produto0_
Hibernate: select loja0_.id as id1_1_0_, loja0_.nome as nome2_1_0_ from Loja loja0_ where loja0_.id=?
Hibernate: select loja0_.id as id1_1_0_, loja0_.nome as nome2_1_0_ from Loja loja0_ where loja0_.id=?
Hibernate: select loja0_.id as id1_1_0_, loja0_.nome as nome2_1_0_ from Loja loja0_ where loja0_.id=?
Hibernate: select loja0_.id as id1_1_0_, loja0_.nome as nome2_1_0_ from Loja loja0_ where loja0_.id=?
Desde já agradeço a ajuda