Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.25 KB | None | 0 0
  1. package SDev3Repeat;
  2.  
  3. import javax.persistence.*;
  4. import java.util.Calendar;
  5.  
  6. @Entity
  7. @Table(name = "CASHIER")
  8. @SuppressWarnings("SerializableClass")
  9. public class Cashier {
  10.  
  11. @Id
  12. private int cashierId;
  13. private String name;
  14. private String address;
  15. @Temporal(TemporalType.DATE)
  16. private Calendar DOB; //Date of Birth of the cashier
  17.  
  18. @OneToOne
  19. @JoinColumn(name = "transID")
  20. private Bill bill;
  21.  
  22. public Cashier(){
  23.  
  24. }
  25.  
  26. public Cashier(int cashierId, String name, String address, Calendar DOB) {
  27. this.cashierId = cashierId;
  28. this.name = name;
  29. this.address = address;
  30. this.DOB = DOB;
  31. }
  32.  
  33. public int getCashierId() {
  34. return cashierId;
  35. }
  36.  
  37. public void setCashierId(int cashierId) {
  38. this.cashierId = cashierId;
  39. }
  40.  
  41. public String getName() {
  42. return name;
  43. }
  44.  
  45. public void setName(String name) {
  46. this.name = name;
  47. }
  48.  
  49. public String getAddress() {
  50. return address;
  51. }
  52.  
  53. public void setAddress(String address) {
  54. this.address = address;
  55. }
  56.  
  57. public Calendar getDOB() {
  58. return DOB;
  59. }
  60.  
  61. public void setDOB(Calendar DOB) {
  62. this.DOB = DOB;
  63. }
  64.  
  65. public Bill getTransaction() {
  66. return bill;
  67. }
  68.  
  69. public void setTransaction(Bill bill) {
  70. this.bill = bill;
  71. }
  72.  
  73. @Override
  74. public String toString(){
  75. String d = String.format("%1$s %2$tB %2$td, %2$tY",
  76. " Date of Birth:", DOB);
  77. return "Cashier ID: "+cashierId+" | Cashier Name: "+name+" | Cashier Address: "+address+" | Cashier Date Of Birth: "+d;
  78. }
  79. }
  80.  
  81. package SDev3Repeat;
  82.  
  83. import javax.persistence.*;
  84.  
  85. @Entity
  86. @Table(name = "COFFEE")
  87. @SuppressWarnings("SerializableClass")
  88. public class Coffee {
  89.  
  90. @Id
  91. private int coffeeId;
  92. private String type;
  93. private String size;
  94. private double price;
  95.  
  96. @ManyToOne()
  97. @JoinColumn(name = "TRANSID")
  98. private Bill trans;
  99.  
  100. public Coffee(){
  101.  
  102. }
  103.  
  104. public Coffee(int coffeeId, String type, String size, double price){
  105. this.coffeeId = coffeeId;
  106. this.type = type;
  107. this.size = size;
  108. this.price = price;
  109. }
  110.  
  111. public int getCoffeeId() {
  112. return coffeeId;
  113. }
  114.  
  115. public void setCoffeeId(int coffeeId) {
  116. this.coffeeId = coffeeId;
  117. }
  118.  
  119. public String getType() {
  120. return type;
  121. }
  122.  
  123. public void setType(String type) {
  124. this.type = type;
  125. }
  126.  
  127. public String getSize() {
  128. return size;
  129. }
  130.  
  131. public void setSize(String size) {
  132. this.size = size;
  133. }
  134.  
  135. public double getPrice() {
  136. return price;
  137. }
  138.  
  139. public void setPrice(double price) {
  140. this.price = price;
  141. }
  142.  
  143. public void setTrans(Bill trans) {
  144. this.trans = trans;
  145. }
  146.  
  147. @Override
  148. public String toString(){
  149. return " ID of Coffee: "+coffeeId+" | Type of Coffee: " + type + " | Size of Coffee: " + size + " | Price of Coffee: " + price;
  150. }
  151.  
  152.  
  153. }
  154.  
  155. import java.util.List;
  156. import java.util.ArrayList;
  157. import javax.persistence.*;
  158.  
  159. @Entity
  160. @Table(name = "BILL")
  161. @Inheritance( strategy = InheritanceType.JOINED )
  162. @SuppressWarnings("SerializableClass")
  163. public class Bill {
  164.  
  165. @Id
  166. private int transId;
  167. private double bill;
  168. private final double VAT = .09; //VAT for hot food and drinks is 9%
  169.  
  170.  
  171. @OneToMany(mappedBy = "trans", cascade = CascadeType.PERSIST)
  172. private List<Coffee> clist = new ArrayList<>();
  173.  
  174. @OneToOne(mappedBy="bill")
  175. private Cashier cashier;
  176.  
  177. private String tempname = cashier.getName();
  178.  
  179. public Bill() {
  180. }
  181.  
  182. public Bill(int transId, double bill,String name) {
  183. this.transId = transId;
  184. this.bill = bill;
  185. this.tempname = name;
  186. }
  187.  
  188. public int getTransId() {
  189. return transId;
  190. }
  191.  
  192. public void setTransId(int transId) {
  193. this.transId = transId;
  194. }
  195.  
  196. public double getBill() {
  197. return bill;
  198. }
  199.  
  200. public void setBill(double bill) {
  201. this.bill = bill;
  202. }
  203.  
  204. public String getTempname() {
  205. return tempname;
  206. }
  207.  
  208. public void setTempname(String tempname) {
  209. this.tempname = tempname;
  210. }
  211.  
  212. public List<Coffee> getClist() {
  213. return clist;
  214. }
  215.  
  216. public void setClist(List<Coffee> clist) {
  217. this.clist = clist;
  218. }
  219.  
  220. public Cashier getCashier() {
  221. return cashier;
  222. }
  223.  
  224. public void setCashier(Cashier cashier) {
  225. this.cashier = cashier;
  226. }
  227.  
  228. @Override
  229. public String toString() {
  230. String s="";
  231. for(int i=0;i<clist.size();i++) {
  232. s+= clist.get(i);
  233. }
  234. return s;
  235. }
  236.  
  237. public double calcBill(Double tempBill){
  238. bill = tempBill + (tempBill * VAT);
  239. return bill;
  240. }
  241.  
  242. }
  243.  
  244. import java.util.Scanner;
  245. import java.util.Calendar;
  246. import javax.persistence.*;
  247.  
  248. public class TestCoffee {
  249. public static void main(String[] args){
  250.  
  251. EntityManagerFactory emf = Persistence.createEntityManagerFactory("SDEVRepeatCAPU");
  252. EntityManager em = emf.createEntityManager();
  253.  
  254.  
  255. Calendar dob = Calendar.getInstance();
  256. dob.set(1992, 06, 23);
  257. Cashier cashier = new Cashier(1,"John Smith", "123 South Street, Dublin",dob);
  258. em.getTransaction().begin();
  259. em.persist(cashier);
  260. em.getTransaction().commit();
  261.  
  262. Scanner in = new Scanner(System.in);
  263.  
  264. Coffee c = new Coffee(1,"Espresso","Solo",2.00);
  265. em.getTransaction().begin();
  266. em.persist(c);
  267. em.getTransaction().commit();
  268.  
  269. c.setCoffeeId(2);
  270. c.setType("Espresso");
  271. c.setSize("Doppio");
  272. c.setPrice(2.35);
  273. em.getTransaction().begin();
  274. em.persist(c);
  275. em.getTransaction().commit();
  276.  
  277. c.setCoffeeId(3);
  278. c.setType("Americano");
  279. c.setSize("Large");
  280. c.setPrice(2.85);
  281. em.getTransaction().begin();
  282. em.persist(c);
  283. em.getTransaction().commit();
  284.  
  285. c.setCoffeeId(4);
  286. c.setType("Americano");
  287. c.setSize("Medium");
  288. c.setPrice(2.50);
  289. em.getTransaction().begin();
  290. em.persist(c);
  291. em.getTransaction().commit();
  292.  
  293. c.setCoffeeId(5);
  294. c.setType("Cappuccino");
  295. c.setSize("Large");
  296. c.setPrice(3.45);
  297. em.getTransaction().begin();
  298. em.persist(c);
  299. em.getTransaction().commit();
  300.  
  301. c.setCoffeeId(6);
  302. c.setType("Cappuccino");
  303. c.setSize("Medium");
  304. c.setPrice(3.00);
  305. em.getTransaction().begin();
  306. em.persist(c);
  307. em.getTransaction().commit();
  308.  
  309. c.setCoffeeId(7);
  310. c.setType("Flat white");
  311. c.setSize("Small");
  312. c.setPrice(3.25);
  313. em.getTransaction().begin();
  314. em.persist(c);
  315. em.getTransaction().commit();
  316.  
  317. c.setCoffeeId(8);
  318. c.setType("Caffè Latte");
  319. c.setSize("Large");
  320. c.setPrice(3.45);
  321. em.getTransaction().begin();
  322. em.persist(c);
  323. em.getTransaction().commit();
  324.  
  325. c.setCoffeeId(9);
  326. c.setType("Caffè Latte");
  327. c.setSize("Medium");
  328. c.setPrice(3.00);
  329. em.getTransaction().begin();
  330. em.persist(c);
  331. em.getTransaction().commit();
  332.  
  333. c.setCoffeeId(10);
  334. c.setType("Caffè Mocha");
  335. c.setSize("Large");
  336. c.setPrice(4.00);
  337. em.getTransaction().begin();
  338. em.persist(c);
  339. em.getTransaction().commit();
  340.  
  341. c.setCoffeeId(11);
  342. c.setType("Caffè Mocha");
  343. c.setSize("Medium");
  344. c.setPrice(3.50);
  345. em.getTransaction().begin();
  346. em.persist(c);
  347. em.getTransaction().commit();
  348.  
  349.  
  350. Bill b = new Bill(1,10.20,"John Smith");
  351.  
  352. System.out.println("Would you like to Create(Enter C),Read(Enter R),Update(Enter U) or Delete(Enter D):");
  353. String choice = in.nextLine();
  354. int IdChoice;
  355. int transId = 1;
  356. int coffId = 11;
  357. int cashId = 1;
  358. String cont = "y";
  359. while("y".equalsIgnoreCase(cont)){
  360. if("C".equalsIgnoreCase(choice)){ //finished
  361. System.out.println("From what class would you like to Create? Transaction(Enter T), Cashier(enter Cash) or Coffee(Enter Coff):");
  362. choice = in.nextLine();
  363. if("T".equalsIgnoreCase(choice)){ //finished
  364. System.out.println("Please enter Total for bill - vat:");
  365. double tempbill = in.nextDouble();
  366. b.setBill(b.calcBill(tempbill));
  367. transId++;
  368. b.setTransId(transId);
  369. System.out.println("Please enter Cashiers ID:");
  370. IdChoice = in.nextInt();
  371. cashier = em.find(Cashier.class, IdChoice);
  372. b.setTempname(cashier.getName());
  373. em.getTransaction().begin();
  374. em.persist(b);
  375. em.getTransaction().commit();
  376. }else if("Cash".equalsIgnoreCase(choice)){ //finished
  377. System.out.println("Please enter cashiers Name:");
  378. cashier.setName(in.nextLine());
  379. System.out.println("Please enter cashiers Address:");
  380. cashier.setAddress(in.nextLine());
  381. System.out.println("Please enter Year of Birth(YYYY):");
  382. int YOB = in.nextInt();
  383. System.out.println("Please enter Month of Birth(MM):");
  384. int MOB = in.nextInt();
  385. System.out.println("Please enter Day of Birth(DD):");
  386. int dayOB = in.nextInt();
  387. dob.set(YOB,MOB,dayOB);
  388. cashier.setDOB(dob);
  389. cashId++;
  390. cashier.setCashierId(cashId);
  391. em.getTransaction().begin();
  392. em.persist(cashier);
  393. em.getTransaction().commit();
  394. }else if("Coff".equalsIgnoreCase(choice)){ //finished
  395. System.out.println("Please Enter Name of Coffee:");
  396. c.setType(in.nextLine());
  397. System.out.println("Please Enter Size of Coffee:");
  398. c.setSize(in.nextLine());
  399. System.out.println("Please Enter Price of Coffee:");
  400. c.setPrice(in.nextDouble());
  401. coffId++;
  402. c.setCoffeeId(coffId);
  403. em.getTransaction().begin();
  404. em.persist(c);
  405. em.getTransaction().commit();
  406.  
  407. }else{
  408. System.out.println("Error Incorrect value");
  409. }
  410. }else if("R".equalsIgnoreCase(choice)){ //finished
  411. System.out.println("From what class would you like to Read? Transaction(Enter T), Cashier(enter Cash) or Coffee(Enter Coff):");
  412. choice = in.nextLine();
  413. if("T".equalsIgnoreCase(choice)){
  414. System.out.println("Enter Transaction Id that you wish to view");
  415. IdChoice = in.nextInt();
  416. b = em.find(Bill.class,IdChoice);
  417. System.out.println(b);
  418. }else if("Cash".equalsIgnoreCase(choice)){
  419. System.out.println("Enter Cashier Id that you wish to view");
  420. IdChoice = in.nextInt();
  421. cashier = em.find(Cashier.class, IdChoice);
  422. System.out.println(cashier);
  423. }else if("Coff".equalsIgnoreCase(choice)){
  424. System.out.println("Enter Coffee Id that you wish to view");
  425. IdChoice = in.nextInt();
  426. c = em.find(Coffee.class, IdChoice);
  427. System.out.println(c);
  428. }else{
  429. System.out.println("Error Incorrect value");
  430. }
  431. }else if("U".equalsIgnoreCase(choice)){ //FINISHED
  432. System.out.println("From what class would you like to Update? Transaction(Enter T), Cashier(enter Cash) or Coffee(Enter Coff):");
  433. choice = in.nextLine();
  434. if("T".equalsIgnoreCase(choice)){
  435. System.out.println("Enter Transaction Id that you wish to Update");
  436. IdChoice = in.nextInt();
  437. b = em.find(Bill.class, IdChoice);
  438. System.out.println("What would you like to update? Cashier name(C) or Bill(B)");
  439. choice = in.nextLine();
  440. if("C".equalsIgnoreCase(choice)){
  441. System.out.println("Enter Cashier Id you wish to use:");
  442. IdChoice = in.nextInt();
  443. cashier = em.find(Cashier.class, IdChoice);
  444. b.setTempname(cashier.getName());
  445. }else if("B".equalsIgnoreCase(choice)){
  446. System.out.println("Enter new Bill Amount:");
  447. double tempbill = in.nextDouble();
  448. b.setBill(b.calcBill(tempbill));
  449. }else{
  450. System.out.println("Error Incorrect value");
  451. }
  452.  
  453. }else if("Cash".equalsIgnoreCase(choice)){
  454. System.out.println("Enter Cashier Id that you wish to Update");
  455. IdChoice = in.nextInt();
  456. cashier = em.find(Cashier.class, IdChoice);
  457. System.out.println("What would you like to update? Cashier name(N) Or Address(A)"); // No date of birth option as you cant change when you are born
  458. choice = in.nextLine();
  459. if("N".equalsIgnoreCase(choice)){
  460. System.out.println("Enter New Name:");
  461. cashier.setName(in.nextLine());
  462. }else if("A".equalsIgnoreCase(choice)){
  463. System.out.println("Enter New Address:");
  464. cashier.setAddress(in.nextLine());
  465. }else{
  466. System.out.println("Error Incorrect value");
  467. }
  468. em.getTransaction().begin();
  469. em.persist(cashier);
  470. em.getTransaction().commit();
  471. }else if("Coff".equalsIgnoreCase(choice)){
  472. System.out.println("Enter Coffee Id that you wish to Update");
  473. IdChoice = in.nextInt();
  474. c = em.find(Coffee.class, IdChoice);
  475. System.out.println("Whar would you like to update? Coffee name(N),Size(S) or Price(P)");
  476. choice = in.nextLine();
  477. if("N".equalsIgnoreCase(choice)){
  478. System.out.println("Please Enter New Name of Coffee:");
  479. c.setType(in.nextLine());
  480. }else if("S".equalsIgnoreCase(choice)){
  481. System.out.println("Please Enter New Size of Coffee:");
  482. c.setSize(in.nextLine());
  483. }else if("P".equalsIgnoreCase(choice)){
  484. System.out.println("Please Enter Price of Coffee:");
  485. c.setPrice(in.nextDouble());
  486. }else{
  487. System.out.println("Error Incorrect value");
  488. }
  489. em.getTransaction().begin();
  490. em.persist(c);
  491. em.getTransaction().commit();
  492. }else{
  493. System.out.println("Error Incorrect value");
  494. }
  495. }else if("D".equalsIgnoreCase(choice)){ //UNFINISHED
  496. System.out.println("From what class would you like to Delete? Transaction(Enter T), Cashier(enter Cash) or Coffee(Enter Coff):");
  497. choice = in.nextLine();
  498. if("T".equalsIgnoreCase(choice)){
  499. System.out.println("Enter Transaction Id that you wish to Delete");
  500. IdChoice = in.nextInt();
  501. b = em.find(Bill.class, IdChoice);
  502. em.getTransaction().begin();
  503. em.remove(b);
  504. em.getTransaction().commit();
  505. }else if("Cash".equalsIgnoreCase(choice)){
  506. System.out.println("Enter Cashier Id that you wish to Delete");
  507. IdChoice = in.nextInt();
  508. cashier = em.find(Cashier.class, IdChoice);
  509. em.getTransaction().begin();
  510. em.remove(cashier);
  511. em.getTransaction().commit();
  512. }else if("Coff".equalsIgnoreCase(choice)){
  513. System.out.println("Enter Coffee Id that you wish to Delete");
  514. IdChoice = in.nextInt();
  515. c = em.find(Coffee.class, IdChoice);
  516. em.getTransaction().begin();
  517. em.remove(c);
  518. em.getTransaction().commit();
  519. }else{
  520. System.out.println("Error Incorrect value");
  521. }
  522. }else{
  523. System.out.println("Error Incorrect value");
  524. }
  525. System.out.println("Do you want to continue Y or N:");
  526. cont = in.nextLine();
  527. }
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536. }
  537. }
  538.  
  539. <?xml version="1.0" encoding="UTF-8"?>
  540. <persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
  541. <persistence-unit name="SDEVRepeatCAPU" transaction-type="RESOURCE_LOCAL">
  542. <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
  543. <class>SDev3Repeat.Cashier</class>
  544. <class>SDev3Repeat.Coffee</class>
  545. <class>SDev3Repeat.Bill</class>
  546. <properties>
  547. <property name="javax.persistence.jdbc.url" value="jdbc:oracle:thin:@localhost:1521:XE"/>
  548. <property name="javax.persistence.jdbc.user" value="hr"/>
  549. <property name="javax.persistence.jdbc.driver" value="oracle.jdbc.OracleDriver"/>
  550. <property name="javax.persistence.jdbc.password" value="passhr"/>
  551. <!-- <property name="javax.persistence.jdbc.url" value="jdbc:oracle:thin:@10.10.2.7:1521/global1"/>
  552. <property name="javax.persistence.jdbc.user" value=""/>
  553. <property name="javax.persistence.jdbc.driver" value="oracle.jdbc.OracleDriver"/>
  554. <property name="javax.persistence.jdbc.password" value=""/>-->
  555. <property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
  556. </properties>
  557.  
  558. [EL Info]: 2017-08-22 17:45:37.248--ServerSession(1203142603)--EclipseLink, version: Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd
  559. [EL Severe]: 2017-08-22 17:45:38.744--ServerSession(1203142603)--Exception
  560. [EclipseLink-0] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd):
  561. org.eclipse.persistence.exceptions.IntegrityException
  562. Descriptor Exceptions:
  563. ---------------------------------------------------------
  564.  
  565. Exception [EclipseLink-168] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DescriptorException
  566. Exception Description: Problem in creating new instance using the default constructor. The default constructor triggered an exception.
  567. Internal Exception: java.lang.reflect.InvocationTargetException
  568. Target Invocation Exception: java.lang.NullPointerException
  569. Descriptor: RelationalDescriptor(SDev3Repeat.Bill --> [DatabaseTable(BILL)])
  570.  
  571. Runtime Exceptions:
  572. ---------------------------------------------------------
  573.  
  574. [EL Info]: connection: 2017-08-22 17:45:38.749--ServerSession(1203142603)--file:/C:/Users/Aran/Documents/NetBeansProjects/SDEV3RepeatCA/build/classes/_SDEVRepeatCAPU logout successful
  575. Exception in thread "main" javax.persistence.PersistenceException: Exception
  576. [EclipseLink-28019] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.EntityManagerSetupException
  577. Exception Description: Deployment of PersistenceUnit [SDEVRepeatCAPU] failed. Close all factories for this PersistenceUnit.
  578. [EL Severe]: ejb: 2017-08-22 17:45:38.758--ServerSession(1203142603)--Exception [EclipseLink-0] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.IntegrityException
  579. Descriptor Exceptions:
  580. ---------------------------------------------------------
  581.  
  582. Internal Exception: Exception [EclipseLink-0] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.IntegrityException
  583. Descriptor Exceptions:
  584. ---------------------------------------------------------
  585.  
  586. Exception [EclipseLink-168] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DescriptorException
  587. Exception Description: Problem in creating new instance using the default constructor. The default constructor triggered an exception.
  588. Exception [EclipseLink-168] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DescriptorException
  589. Internal Exception: java.lang.reflect.InvocationTargetException
  590. Target Invocation Exception: java.lang.NullPointerException
  591. Exception Description: Problem in creating new instance using the default constructor. The default constructor triggered an exception.
  592. Descriptor: RelationalDescriptor(SDev3Repeat.Bill --> [DatabaseTable(BILL)])
  593.  
  594. Internal Exception: java.lang.reflect.InvocationTargetException
  595. Runtime Exceptions:
  596. ---------------------------------------------------------
  597.  
  598. Target Invocation Exception: java.lang.NullPointerException
  599. Descriptor: RelationalDescriptor(SDev3Repeat.Bill --> [DatabaseTable(BILL)])
  600.  
  601. Runtime Exceptions:
  602. ---------------------------------------------------------
  603.  
  604. at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.createDeployFailedPersistenceException(EntityManagerSetupImpl.java:820)
  605. at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:760)
  606. at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getAbstractSession(EntityManagerFactoryDelegate.java:204)
  607. at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:182)
  608. at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getDatabaseSession(EntityManagerFactoryImpl.java:527)
  609. at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactoryImpl(PersistenceProvider.java:140)
  610. at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactory(PersistenceProvider.java:177)
  611. at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:79)
  612. at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54)
  613. at SDev3Repeat.TestCoffee.main(TestCoffee.java:15)
  614. Caused by: Exception [EclipseLink-28019] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.EntityManagerSetupException
  615. Exception Description: Deployment of PersistenceUnit [SDEVRepeatCAPU] failed. Close all factories for this PersistenceUnit.
  616. Internal Exception: Exception [EclipseLink-0] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.IntegrityException
  617. Descriptor Exceptions:
  618. ---------------------------------------------------------
  619.  
  620. Exception [EclipseLink-168] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DescriptorException
  621. Exception Description: Problem in creating new instance using the default constructor. The default constructor triggered an exception.
  622. Internal Exception: java.lang.reflect.InvocationTargetException
  623. Target Invocation Exception: java.lang.NullPointerException
  624. Descriptor: RelationalDescriptor(SDev3Repeat.Bill --> [DatabaseTable(BILL)])
  625.  
  626. Runtime Exceptions:
  627. ---------------------------------------------------------
  628.  
  629. at org.eclipse.persistence.exceptions.EntityManagerSetupException.deployFailed(EntityManagerSetupException.java:238)
  630. ... 10 more
  631. Caused by: Exception [EclipseLink-0] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.IntegrityException
  632. Descriptor Exceptions:
  633. ---------------------------------------------------------
  634.  
  635. Exception [EclipseLink-168] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DescriptorException
  636. Exception Description: Problem in creating new instance using the default constructor. The default constructor triggered an exception.
  637. Internal Exception: java.lang.reflect.InvocationTargetException
  638. Target Invocation Exception: java.lang.NullPointerException
  639. Descriptor: RelationalDescriptor(SDev3Repeat.Bill --> [DatabaseTable(BILL)])
  640.  
  641. Runtime Exceptions:
  642. ---------------------------------------------------------
  643.  
  644. at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:696)
  645. at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:632)
  646. at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:568)
  647. at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.postConnectDatasource(DatabaseSessionImpl.java:799)
  648. at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:743)
  649. at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:239)
  650. at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:685)
  651. ... 8 more
  652. Java Result: 1
  653. BUILD SUCCESSFUL (total time: 4 seconds)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement