Commit 98bf3907 by Patryk Czarnik

Poprawka konfiguracji

parent 7b331ae8
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.2" 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_2.xsd"> <persistence version="2.2" 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_2.xsd">
<persistence-unit name="PC27-Hibernate"> <persistence-unit name="sklep" transaction-type="RESOURCE_LOCAL">
<class>sklep.model.Customer</class> <class>sklep.model.Customer</class>
<class>sklep.model.OrderProduct</class> <class>sklep.model.OrderProduct</class>
<class>sklep.model.OrderProductPK</class> <class>sklep.model.OrderProductPK</class>
<class>sklep.model.Order</class> <class>sklep.model.Order</class>
<class>sklep.model.Product</class> <class>sklep.model.Product</class>
<properties>
<property name="javax.persistence.jdbc.url" value="jdbc:postgresql://localhost:5432/sklep"/>
<property name="javax.persistence.jdbc.user" value="kurs"/>
<property name="javax.persistence.jdbc.password" value="abc123"/>
<property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver"/>
<property name="hibernate.show_sql" value="true"/> <!-- pokazywanie zapytań SQL -->
</properties>
</persistence-unit> </persistence-unit>
</persistence> </persistence>
...@@ -28,12 +28,12 @@ public class OrderProduct implements Serializable { ...@@ -28,12 +28,12 @@ public class OrderProduct implements Serializable {
//bi-directional many-to-one association to Order //bi-directional many-to-one association to Order
@ManyToOne @ManyToOne
@JoinColumn(name="order_id") @JoinColumn(name="order_id", insertable=false, updatable=false)
private Order order; private Order order;
//uni-directional many-to-one association to Product //uni-directional many-to-one association to Product
@ManyToOne @ManyToOne
@JoinColumn(name="product_id") @JoinColumn(name="product_id", insertable=false, updatable=false)
private Product product; private Product product;
public OrderProduct() { public OrderProduct() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment