Advertisement
Guest User

Untitled

a guest
Feb 12th, 2017
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.16 KB | None | 0 0
  1. @Entity
  2. public class Client implements Serializable {
  3. @Id @GeneratedValue
  4. private long code;
  5. private String nom;
  6. private String email;
  7. @OneToMany(mappedBy = "client",fetch = FetchType.LAZY)
  8. private Collection<Compte> comptes;
  9. public Client(long code, String nom, String email, Collection<Compte> comptes) {
  10. this.code = code;
  11. this.nom = nom;
  12. this.email = email;
  13. this.comptes = comptes;
  14. }
  15. /...
  16. getters and setters
  17. }
  18.  
  19. @Entity
  20. @Inheritance(strategy = InheritanceType.SINGLE_TABLE)
  21. @DiscriminatorColumn(name = "TYPE_CPTE,",discriminatorType= DiscriminatorType.STRING,length = 2)
  22. public abstract class Compte implements Serializable {
  23. @Id
  24. private String codeCompte;
  25. private Date dataCreation;
  26. private double solde;
  27. @ManyToOne
  28. @JoinColumn(name="CODE_CLI")
  29. private Client client;
  30. @OneToMany(mappedBy="compte")
  31. private Collection<Operation> operations;
  32.  
  33. public Compte() {
  34. super();
  35. }
  36.  
  37. public Compte(String codeCompte, Date dataCreation, double solde, Client client, Collection<Operation> operations) {
  38. this.codeCompte = codeCompte;
  39. this.dataCreation = dataCreation;
  40. this.solde = solde;
  41. this.client = client;
  42. this.operations = operations;
  43. }
  44.  
  45. /...
  46. getters and setters
  47. }
  48.  
  49. @Entity
  50. @Inheritance(strategy = InheritanceType.SINGLE_TABLE)
  51. @DiscriminatorColumn(name = "TYPE_OP",discriminatorType = DiscriminatorType.STRING,length = 1)
  52. public abstract class Operation implements Serializable{
  53. @Id @GeneratedValue
  54. private long numero;
  55. private Date dateOperation;
  56. private double montant;
  57. @ManyToOne
  58. @JoinColumn(name = "CODE_CPTE")
  59. private Compte compte;
  60.  
  61. public Operation() {
  62. super();
  63. }
  64.  
  65. public Operation(Date dateOperation, double montant, Compte compte) {
  66. this.dateOperation = dateOperation;
  67. this.montant = montant;
  68. this.compte = compte;
  69. }
  70. /...getters and setters
  71. }
  72.  
  73. @Entity
  74. @DiscriminatorValue("R")
  75. public class Retrait extends Operation {
  76. public Retrait() {
  77. }
  78. public Retrait(Date dateOperation, double montant, Compte compte) {
  79. super(dateOperation, montant, compte);
  80. }
  81. }
  82.  
  83. @Entity
  84. @DiscriminatorValue("V")
  85. public class Versement extends Operation {
  86. public Versement() {
  87. }
  88. public Versement(Date dateOperation, double montant, Compte compte) {
  89. super(dateOperation, montant, compte);
  90. }
  91. }
  92.  
  93. @Entity
  94. @DiscriminatorValue("CE")
  95. public class CompteEpargne extends Compte {
  96. private double taux;
  97. public CompteEpargne(String s, Date date, int i, Client c2, double taux) {
  98. this.taux = taux;
  99. }
  100.  
  101. public CompteEpargne(String codeCompte, Date dataCreation, double solde, Client client, Collection<Operation> operations, double taux) {
  102. super(codeCompte, dataCreation, solde, client, operations);
  103. this.taux = taux;
  104. }
  105. public CompteEpargne(){
  106. super();
  107. }
  108. /...getters and setters
  109. }
  110. **entity CompteEpagne**
  111.  
  112. @Entity
  113. @DiscriminatorValue("CC")
  114. public class CompteCourant extends Compte {
  115. private double decouvert;
  116.  
  117. public CompteCourant(String s, Date date, int i, Client c1, double decouvert) {
  118. this.decouvert = decouvert;
  119. }
  120.  
  121. public CompteCourant(String codeCompte, Date dataCreation, double solde, Client client, Collection<Operation> operations, double decouvert) {
  122. super(codeCompte, dataCreation, solde, client, operations);
  123. this.decouvert = decouvert;
  124. }
  125. public CompteCourant(){
  126. super();
  127. }
  128. /...getters and setters
  129. }
  130.  
  131. @Repository
  132. public interface ClientRep extends JpaRepository<Client,Long> {
  133. }
  134.  
  135. @Repository
  136. public interface CompteRep extends JpaRepository<Compte,String> {
  137. }
  138.  
  139. @Repository
  140. public interface OperationRep extends JpaRepository<Operation,Long> {
  141. @Query("select o from Operation o where o.compte.codeCompte=:x order by o.dateOperation desc ")
  142. public Page<Operation> listOperation(String codeCpte, Pageable pageable);
  143. }
  144.  
  145. public interface IBankMetier {
  146. public Compte consulterCompte(String codeCpte);
  147. public void verser(String codeCpte, double montant);
  148. public void retirer(String codeCpte, double montant);
  149. public void virement(String codeCpte1, String codeCpte2, double montant);
  150. public Page<Operation> listOperation(String codeCpte, int page, int size);
  151. }
  152.  
  153. @Service
  154. @Transactional
  155. public class BankMetierImp implements IBankMetier {
  156. @Autowired
  157. private CompteRep compteRep;
  158. @Autowired
  159. private OperationRep operationRep;
  160. @Override
  161. public Compte consulterCompte(String codeCpte) {
  162. Compte cp = compteRep.findOne(codeCpte);
  163. if (cp == null) throw new RuntimeException("Compte introvable");
  164. return cp;
  165. }
  166.  
  167. @Override
  168. public void verser(String codeCpte, double montant) {
  169. Compte cp = consulterCompte(codeCpte);
  170. Versement v = new Versement(new Date(), montant, cp);
  171. operationRep.save(v);
  172. cp.setSolde((cp.getSolde() + montant));
  173. compteRep.save(cp);
  174. }
  175.  
  176. @Override
  177. public void retirer(String codeCpte, double montant) {
  178. Compte cp = consulterCompte(codeCpte);
  179. double facili = 0;
  180. if (cp instanceof CompteCourant)
  181. facili = ((CompteCourant) cp).getDecouvert();
  182. if (cp.getSolde() + facili < montant)
  183. throw new RuntimeException("solde insuffisant");
  184. Retrait retrait = new Retrait(new Date(), montant, cp);
  185. operationRep.save(retrait);
  186. cp.setSolde((cp.getSolde() - montant));
  187. compteRep.save(cp);
  188. }
  189.  
  190. @Override
  191. public void virement(String codeCpte1, String codeCpte2, double montant) {
  192. retirer(codeCpte1, montant);
  193. verser(codeCpte2, montant);
  194. }
  195.  
  196. @Override
  197. public Page<Operation> listOperation(String codeCpte, int page, int size) {
  198. return operationRep.listOperation(codeCpte,new PageRequest(page,size));
  199. }
  200. }
  201.  
  202. @SpringBootApplication
  203. public class MeinproApplication implements CommandLineRunner {
  204. @Autowired
  205. private ClientRep clientRep;
  206. @Autowired
  207. private CompteRep compteRep;
  208. @Autowired
  209. private OperationRep operationRep;
  210. @Autowired
  211. BankMetierImp bankMetier;
  212. public static void main(String[] args) {
  213. SpringApplication.run(MeinproApplication.class, args);
  214.  
  215. }
  216. @Override
  217. public void run(String... strings) throws Exception {
  218. Client c1=clientRep.save(new Client("martin","martin@gmail.com"));
  219. Client c2=clientRep.save(new Client("john","john@gmail.com"));
  220.  
  221. Compte cp1=compteRep.save(new CompteCourant("c1",new Date(),9000,c1,6000));
  222. Compte cp2=compteRep.save(new CompteEpargne("c2",new Date(),63000,c2,12220));
  223.  
  224. operationRep.save(new Retrait(new Date(),6000,cp1));
  225. operationRep.save(new Retrait(new Date(),10000,cp2));
  226. operationRep.save(new Versement(new Date(),2000,cp1));
  227. operationRep.save(new Versement(new Date(),20,cp2));
  228. bankMetier.verser("c1",1000);
  229. bankMetier.virement("c1","c2",2000);
  230.  
  231. }
  232. }
  233.  
  234. # DataSource settings:
  235. spring.datasource.url=jdbc:mysql://localhost:3306/monbank
  236. spring.datasource.username=roo
  237. spring.datasource.password=
  238. spring.datasource.driver-class-name=com.mysql.jdbc.Driver
  239. spring.jpa.show-sql=true
  240. spring.jpa.hibernate.ddl-auto=create-drop
  241. spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
  242.  
  243. 2017-02-12 16:15:24.858 INFO 6232 --- [ restartedMain] org.hibernate.Version : HHH000412: Hibernate Core {5.0.11.Final}
  244. 2017-02-12 16:15:24.860 INFO 6232 --- [ restartedMain] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
  245. 2017-02-12 16:15:24.863 INFO 6232 --- [ restartedMain] org.hibernate.cfg.Environment : HHH000021: Bytecode provider name : javassist
  246. 2017-02-12 16:15:24.947 INFO 6232 --- [ restartedMain] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
  247. 2017-02-12 16:15:25.113 INFO 6232 --- [ restartedMain] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect
  248. 2017-02-12 16:15:25.938 INFO 6232 --- [ restartedMain] org.hibernate.tuple.PojoInstantiator : HHH000182: No default (no-argument) constructor for class: meinpro.entiti.Client (class must be instantiated by Interceptor)
  249. 2017-02-12 16:15:26.209 INFO 6232 --- [ restartedMain] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000227: Running hbm2ddl schema export
  250. Hibernate: alter table compte drop foreign key FK2hw4shqsxc782lychpkr52lmv
  251. 2017-02-12 16:15:26.228 ERROR 6232 --- [ restartedMain] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000389: Unsuccessful: alter table compte drop foreign key FK2hw4shqsxc782lychpkr52lmv
  252. 2017-02-12 16:15:26.228 ERROR 6232 --- [ restartedMain] org.hibernate.tool.hbm2ddl.SchemaExport : Table 'monbank.compte' doesn't exist
  253. Hibernate: alter table operation drop foreign key FKkr9nfjf0ipqrw5xwcf9jqq6gv
  254. 2017-02-12 16:15:26.229 ERROR 6232 --- [ restartedMain] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000389: Unsuccessful: alter table operation drop foreign key FKkr9nfjf0ipqrw5xwcf9jqq6gv
  255. 2017-02-12 16:15:26.229 ERROR 6232 --- [ restartedMain] org.hibernate.tool.hbm2ddl.SchemaExport : Table 'monbank.operation' doesn't exist
  256. Hibernate: drop table if exists client
  257. Hibernate: drop table if exists compte
  258. Hibernate: drop table if exists operation
  259. Hibernate: create table client (code bigint not null auto_increment, email varchar(255), nom varchar(255), primary key (code))
  260. Hibernate: create table compte (type_cpte, varchar(2) not null, code_compte varchar(255) not null, data_creation datetime, solde double precision not null, decouvert double precision, taux double precision, code_cli bigint, primary key (code_compte))
  261. 2017-02-12 16:15:26.712 ERROR 6232 --- [ restartedMain] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000389: Unsuccessful: create table compte (type_cpte, varchar(2) not null, code_compte varchar(255) not null, data_creation datetime, solde double precision not null, decouvert double precision, taux double precision, code_cli bigint, primary key (code_compte))
  262. 2017-02-12 16:15:26.713 ERROR 6232 --- [ restartedMain] org.hibernate.tool.hbm2ddl.SchemaExport : You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' varchar(2) not null, code_compte varchar(255) not null, data_creation datetime,' at line 1
  263. Hibernate: create table operation (type_op varchar(1) not null, numero bigint not null auto_increment, date_operation datetime, montant double precision not null, code_cpte varchar(255), primary key (numero))
  264. Hibernate: alter table compte add constraint FK2hw4shqsxc782lychpkr52lmv foreign key (code_cli) references client (code)
  265. 2017-02-12 16:15:27.146 ERROR 6232 --- [ restartedMain] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000389: Unsuccessful: alter table compte add constraint FK2hw4shqsxc782lychpkr52lmv foreign key (code_cli) references client (code)
  266. 2017-02-12 16:15:27.147 ERROR 6232 --- [ restartedMain] org.hibernate.tool.hbm2ddl.SchemaExport : Table 'monbank.compte' doesn't exist
  267. Hibernate: alter table operation add constraint FKkr9nfjf0ipqrw5xwcf9jqq6gv foreign key (code_cpte) references compte (code_compte)
  268. 2017-02-12 16:15:27.330 ERROR 6232 --- [ restartedMain] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000389: Unsuccessful: alter table operation add constraint FKkr9nfjf0ipqrw5xwcf9jqq6gv foreign key (code_cpte) references compte (code_compte)
  269. 2017-02-12 16:15:27.331 ERROR 6232 --- [ restartedMain] org.hibernate.tool.hbm2ddl.SchemaExport : Can't create table `monbank`.`#sql-23d4_77` (errno: 150 "Foreign key constraint is incorrectly formed")
  270. 2017-02-12 16:15:27.332 INFO 6232 --- [ restartedMain] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000230: Schema export complete
  271. 2017-02-12 16:15:27.414 INFO 6232 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
  272. 2017-02-12 16:15:27.938 INFO 6232 --- [ restartedMain] o.h.h.i.QueryTranslatorFactoryInitiator : HHH000397: Using ASTQueryTranslatorFactory
  273. 2017-02-12 16:15:28.776 INFO 6232 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@2ffb82a2: startup date [Sun Feb 12 16:15:18 PST 2017]; root of context hierarchy
  274. 2017-02-12 16:15:28.936 INFO 6232 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
  275. 2017-02-12 16:15:28.938 INFO 6232 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
  276. 2017-02-12 16:15:29.022 INFO 6232 --- [ restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
  277. 2017-02-12 16:15:29.022 INFO 6232 --- [ restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
  278. 2017-02-12 16:15:29.112 INFO 6232 --- [ restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
  279. 2017-02-12 16:15:29.263 WARN 6232 --- [ restartedMain] .t.AbstractTemplateResolverConfiguration : Cannot find template location: classpath:/templates/ (please add some templates or check your Thymeleaf configuration)
  280. 2017-02-12 16:15:30.063 INFO 6232 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
  281. 2017-02-12 16:15:30.159 INFO 6232 --- [ restartedMain] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
  282. 2017-02-12 16:15:30.246 INFO 6232 --- [ restartedMain] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
  283. Hibernate: insert into client (email, nom) values (?, ?)
  284. Hibernate: insert into client (email, nom) values (?, ?)
  285. 2017-02-12 16:15:30.461 INFO 6232 --- [ restartedMain] utoConfigurationReportLoggingInitializer :
  286.  
  287. Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
  288. 2017-02-12 16:15:30.472 ERROR 6232 --- [ restartedMain] o.s.boot.SpringApplication : Application startup failed
  289.  
  290. java.lang.IllegalStateException: Failed to execute CommandLineRunner
  291. at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:779) [spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
  292. at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:760) [spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
  293. at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:747) [spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
  294. at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
  295. at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162) [spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
  296. at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151) [spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
  297. at meinpro.MeinproApplication.main(MeinproApplication.java:30) [classes/:na]
  298. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]
  299. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121]
  300. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121]
  301. at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121]
  302. at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-1.5.1.RELEASE.jar:1.5.1.RELEASE]
  303. Caused by: org.springframework.orm.jpa.JpaSystemException: ids for this class must be manually assigned before calling save(): meinpro.entiti.Compte; nested exception is org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save(): meinpro.entiti.Compte
  304. at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:333) ~[spring-orm-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  305. at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:244) ~[spring-orm-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  306. at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:491) ~[spring-orm-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  307. at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:59) ~[spring-tx-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  308. at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213) ~[spring-tx-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  309. at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:147) ~[spring-tx-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  310. at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  311. at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:133) ~[spring-data-jpa-1.11.0.RELEASE.jar:na]
  312. at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  313. at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) ~[spring-aop-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  314. at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  315. at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:57) ~[spring-data-commons-1.13.0.RELEASE.jar:na]
  316. at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  317. at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) ~[spring-aop-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  318. at com.sun.proxy.$Proxy86.save(Unknown Source) ~[na:na]
  319. at meinpro.MeinproApplication.run(MeinproApplication.java:38) [classes/:na]
  320. at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:776) [spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
  321. ... 11 common frames omitted
  322. Caused by: org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save(): meinpro.entiti.Compte
  323. at org.hibernate.id.Assigned.generate(Assigned.java:34) ~[hibernate-core-5.0.11.Final.jar:5.0.11.Final]
  324. at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:101) ~[hibernate-core-5.0.11.Final.jar:5.0.11.Final]
  325. at org.hibernate.jpa.event.internal.core.JpaPersistEventListener.saveWithGeneratedId(JpaPersistEventListener.java:67) ~[hibernate-entitymanager-5.0.11.Final.jar:5.0.11.Final]
  326. at org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:189) ~[hibernate-core-5.0.11.Final.jar:5.0.11.Final]
  327. at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:132) ~[hibernate-core-5.0.11.Final.jar:5.0.11.Final]
  328. at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:58) ~[hibernate-core-5.0.11.Final.jar:5.0.11.Final]
  329. at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:775) ~[hibernate-core-5.0.11.Final.jar:5.0.11.Final]
  330. at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:748) ~[hibernate-core-5.0.11.Final.jar:5.0.11.Final]
  331. at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:753) ~[hibernate-core-5.0.11.Final.jar:5.0.11.Final]
  332. at org.hibernate.jpa.spi.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:1146) ~[hibernate-entitymanager-5.0.11.Final.jar:5.0.11.Final]
  333. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]
  334. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121]
  335. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121]
  336. at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121]
  337. at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:298) ~[spring-orm-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  338. at com.sun.proxy.$Proxy82.persist(Unknown Source) ~[na:na]
  339. at org.springframework.data.jpa.repository.support.SimpleJpaRepository.save(SimpleJpaRepository.java:508) ~[spring-data-jpa-1.11.0.RELEASE.jar:na]
  340. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]
  341. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121]
  342. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121]
  343. at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121]
  344. at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:504) ~[spring-data-commons-1.13.0.RELEASE.jar:na]
  345. at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:489) ~[spring-data-commons-1.13.0.RELEASE.jar:na]
  346. at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:461) ~[spring-data-commons-1.13.0.RELEASE.jar:na]
  347. at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  348. at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:61) ~[spring-data-commons-1.13.0.RELEASE.jar:na]
  349. at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  350. at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) ~[spring-tx-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  351. at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282) ~[spring-tx-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  352. at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) ~[spring-tx-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  353. at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  354. at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136) ~[spring-tx-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  355. ... 22 common frames omitted
  356.  
  357. 2017-02-12 16:15:30.478 INFO 6232 --- [ restartedMain] ationConfigEmbeddedWebApplicationContext : Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@2ffb82a2: startup date [Sun Feb 12 16:15:18 PST 2017]; root of context hierarchy
  358. 2017-02-12 16:15:30.483 INFO 6232 --- [ restartedMain] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
  359. 2017-02-12 16:15:30.485 INFO 6232 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
  360. 2017-02-12 16:15:30.485 INFO 6232 --- [ restartedMain] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000227: Running hbm2ddl schema export
  361. Hibernate: alter table compte drop foreign key FK2hw4shqsxc782lychpkr52lmv
  362. 2017-02-12 16:15:30.488 ERROR 6232 --- [ restartedMain] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000389: Unsuccessful: alter table compte drop foreign key FK2hw4shqsxc782lychpkr52lmv
  363. 2017-02-12 16:15:30.489 ERROR 6232 --- [ restartedMain] org.hibernate.tool.hbm2ddl.SchemaExport : Table 'monbank.compte' doesn't exist
  364. Hibernate: alter table operation drop foreign key FKkr9nfjf0ipqrw5xwcf9jqq6gv
  365. 2017-02-12 16:15:30.499 ERROR 6232 --- [ restartedMain] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000389: Unsuccessful: alter table operation drop foreign key FKkr9nfjf0ipqrw5xwcf9jqq6gv
  366. 2017-02-12 16:15:30.500 ERROR 6232 --- [ restartedMain] org.hibernate.tool.hbm2ddl.SchemaExport : Can't DROP 'FKkr9nfjf0ipqrw5xwcf9jqq6gv'; check that column/key exists
  367. Hibernate: drop table if exists client
  368. Hibernate: drop table if exists compte
  369. Hibernate: drop table if exists operation
  370. 2017-02-12 16:15:30.879 INFO 6232 --- [ restartedMain] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000230: Schema export complete
  371. Process finished with exit code 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement