質問編集履歴
1
画像とソースコードを追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -341,3 +341,107 @@
|
|
341
341
|
検索対象の仮ユーザーテーブル
|
342
342
|
|
343
343
|
![イメージ](93636aa8bbea3832f50cd5269416e9c8.png)
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
実行すると以下のエラーが発生する
|
348
|
+
|
349
|
+
![イメージ](3323840d30bb68b3cdab50460d7982ef.png)
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
```xml
|
354
|
+
|
355
|
+
persistence.xml
|
356
|
+
|
357
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
358
|
+
|
359
|
+
<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
360
|
+
|
361
|
+
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
|
362
|
+
|
363
|
+
version="2.0" xmlns="http://java.sun.com/xml/ns/persistence">
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
<!-- MySQL + TOMCAT-->
|
368
|
+
|
369
|
+
<!--<persistence-unit name="restaurant" transaction-type="RESOURCE_LOCAL">-->
|
370
|
+
|
371
|
+
<persistence-unit name="restaurant">
|
372
|
+
|
373
|
+
<provider>org.hibernate.jpa.HibernatePersistence</provider>
|
374
|
+
|
375
|
+
<exclude-unlisted-classes>false</exclude-unlisted-classes>
|
376
|
+
|
377
|
+
<properties>
|
378
|
+
|
379
|
+
<!-- DAOS -->
|
380
|
+
|
381
|
+
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
|
382
|
+
|
383
|
+
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/restaurant?useSSL=false" />
|
384
|
+
|
385
|
+
<property name="javax.persistence.jdbc.user" value="administrator" />
|
386
|
+
|
387
|
+
<property name="javax.persistence.jdbc.password" value="password" />
|
388
|
+
|
389
|
+
<!-- Configuration-->
|
390
|
+
|
391
|
+
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/>
|
392
|
+
|
393
|
+
<property name="hibernate.hbm2ddl.auto" value="update"/>
|
394
|
+
|
395
|
+
<property name="hibernate.show_sql" value="true"/>
|
396
|
+
|
397
|
+
<property name="hibernate.format_sql" value="true"/>
|
398
|
+
|
399
|
+
<property name="hibernate.archive.autodetection" value="class"/>
|
400
|
+
|
401
|
+
<!-- POOL
|
402
|
+
|
403
|
+
<property name="hibernate.c3p0.min_size" value="5"/>
|
404
|
+
|
405
|
+
<property name="hibernate.c3p0.max_size" value="20"/>
|
406
|
+
|
407
|
+
<property name="hibernate.c3p0.timeout" value="300"/>
|
408
|
+
|
409
|
+
<property name="hibernate.c3p0.max_statements" value="50"/>
|
410
|
+
|
411
|
+
<property name="hibernate.c3p0.idle_test_period" value="3000"/>
|
412
|
+
|
413
|
+
-->
|
414
|
+
|
415
|
+
</properties>
|
416
|
+
|
417
|
+
</persistence-unit>
|
418
|
+
|
419
|
+
|
420
|
+
|
421
|
+
<!-- JUnit MYSQL -->
|
422
|
+
|
423
|
+
<persistence-unit name="restaurant">
|
424
|
+
|
425
|
+
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
|
426
|
+
|
427
|
+
<properties>
|
428
|
+
|
429
|
+
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
|
430
|
+
|
431
|
+
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/>
|
432
|
+
|
433
|
+
<property name="hibernate.connection.release_mode" value="after_transaction"/>
|
434
|
+
|
435
|
+
<property name="hibernate.connection.username" value="administrator"/>
|
436
|
+
|
437
|
+
<property name="hibernate.connection.password" value="password"/>
|
438
|
+
|
439
|
+
<property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/restaurant?useSSL=false"/>
|
440
|
+
|
441
|
+
</properties>
|
442
|
+
|
443
|
+
</persistence-unit>
|
444
|
+
|
445
|
+
</persistence>
|
446
|
+
|
447
|
+
```
|