Skip to content

Commit 49302e0

Browse files
committed
hibernate integration
1 parent 5408355 commit 49302e0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+525
-497
lines changed

Furniture_Spring/.classpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
2929
</attributes>
3030
</classpathentry>
31-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
31+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
3232
<attributes>
3333
<attribute name="owner.project.facets" value="java"/>
3434
</attributes>
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
eclipse.preferences.version=1
22
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3-
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
4-
org.eclipse.jdt.core.compiler.compliance=1.7
3+
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
4+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
5+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6+
org.eclipse.jdt.core.compiler.compliance=1.8
7+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
8+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
9+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
510
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
611
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
712
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
8-
org.eclipse.jdt.core.compiler.source=1.7
13+
org.eclipse.jdt.core.compiler.source=1.8

Furniture_Spring/.settings/org.eclipse.wst.common.project.facet.core.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<faceted-project>
33
<fixed facet="wst.jsdt.web"/>
44
<installed facet="wst.jsdt.web" version="1.0"/>
5-
<installed facet="java" version="1.7"/>
65
<installed facet="jst.web" version="3.0"/>
76
<installed facet="jst.jsf" version="2.0"/>
87
<installed facet="jst.jaxrs" version="1.1"/>
8+
<installed facet="java" version="1.8"/>
99
</faceted-project>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
default.configuration=
2+
eclipse.preferences.version=1
3+
hibernate3.enabled=false

Furniture_Spring/pom.xml

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,62 @@
2020
</dependency>
2121
<dependency>
2222
<groupId>org.springframework</groupId>
23-
<artifactId>spring-webmvc</artifactId>
23+
<artifactId>spring-context</artifactId>
2424
<version>4.2.2.RELEASE</version>
2525
</dependency>
26+
2627
<dependency>
2728
<groupId>org.springframework</groupId>
28-
<artifactId>spring-jdbc</artifactId>
29+
<artifactId>spring-tx</artifactId>
2930
<version>4.2.2.RELEASE</version>
3031
</dependency>
32+
3133
<dependency>
3234
<groupId>org.springframework</groupId>
33-
<artifactId>spring-tx</artifactId>
35+
<artifactId>spring-core</artifactId>
36+
<version>4.2.2.RELEASE</version>
37+
</dependency>
38+
39+
<dependency>
40+
<groupId>org.springframework</groupId>
41+
<artifactId>spring-web</artifactId>
42+
<version>4.2.2.RELEASE</version>
43+
</dependency>
44+
45+
<dependency>
46+
<groupId>org.springframework</groupId>
47+
<artifactId>spring-context-support</artifactId>
48+
<version>4.2.2.RELEASE</version>
49+
</dependency>
50+
51+
<dependency>
52+
<groupId>org.springframework</groupId>
53+
<artifactId>spring-webmvc</artifactId>
54+
<version>4.2.2.RELEASE</version>
55+
</dependency>
56+
57+
<dependency>
58+
<groupId>org.springframework</groupId>
59+
<artifactId>spring-orm</artifactId>
3460
<version>4.2.2.RELEASE</version>
3561
</dependency>
62+
63+
<dependency>
64+
<groupId>org.hibernate</groupId>
65+
<artifactId>hibernate-entitymanager</artifactId>
66+
<version>5.3.1.Final</version>
67+
</dependency>
68+
69+
<dependency>
70+
<groupId>org.hibernate</groupId>
71+
<artifactId>hibernate-core</artifactId>
72+
<version>5.3.1.Final</version>
73+
</dependency>
74+
<dependency>
75+
<groupId>commons-dbcp</groupId>
76+
<artifactId>commons-dbcp</artifactId>
77+
<version>1.4</version>
78+
</dependency>
3679
<dependency>
3780
<groupId>log4j</groupId>
3881
<artifactId>log4j</artifactId>

Furniture_Spring/src/main/java/com/project/model/Address.java renamed to Furniture_Spring/src/main/java/com/hiber/model/Address.java

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,45 @@
1-
package com.project.model;
1+
package com.hiber.model;
22

33
import java.io.Serializable;
44

5-
public class Address implements Serializable{
6-
String address, city, state, zipcode;
5+
import javax.persistence.Entity;
6+
import javax.persistence.Id;
77

8-
String email;
8+
@Entity
9+
public class Address{
10+
11+
12+
@Id
13+
private String email;
914

1015
public String getEmail() {
11-
return email;
12-
}
16+
return email;
17+
}
18+
19+
20+
public void setEmail(String email) {
21+
this.email = email;
22+
}
23+
24+
25+
private String address;
26+
private String city, state, zipcode;
27+
1328

14-
public Address(String address, String city, String state, String zipcode, String email) {
29+
30+
public Address(String address, String city, String state, String zipcode) {
1531
super();
1632
this.address = address;
1733
this.city = city;
1834
this.state = state;
1935
this.zipcode = zipcode;
20-
this.email = email;
2136
}
2237

23-
public Address(String email) {
24-
super();
25-
this.email = email;
26-
}
2738

2839
@Override
2940
public String toString() {
3041
return "Address [address=" + address + ", city=" + city + ", state=" + state + ", zipcode=" + zipcode + ", email="
31-
+ email + "]";
32-
}
33-
34-
public void setEmail(String email) {
35-
this.email = email;
42+
+ "]";
3643
}
3744

3845
public Address() {
@@ -71,4 +78,5 @@ public void setZipcode(String zipcode) {
7178
this.zipcode = zipcode;
7279
}
7380

81+
7482
}
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
package com.hiber.model;
2+
3+
import java.io.Serializable;
4+
import java.sql.Blob;
5+
6+
import javax.persistence.Entity;
7+
import javax.persistence.Id;
8+
9+
@Entity
10+
public class Admin {
11+
12+
@Id
13+
private String email;
14+
private String firstName,lastName,password,salt,gender;
15+
private String phonenumber,birthdate;
16+
Blob image;
17+
18+
19+
20+
public Blob getImage() {
21+
return image;
22+
}
23+
24+
public void setImage(Blob image) {
25+
this.image = image;
26+
}
27+
28+
public String getSalt() {
29+
return salt;
30+
}
31+
32+
public void setSalt(String salt) {
33+
this.salt = salt;
34+
}
35+
36+
public String getFirstName() {
37+
return firstName;
38+
}
39+
40+
public void setFirstName(String firstName) {
41+
this.firstName = firstName;
42+
}
43+
44+
public String getLastName() {
45+
return lastName;
46+
}
47+
48+
public void setLastName(String lastName) {
49+
this.lastName = lastName;
50+
}
51+
52+
public String getEmail() {
53+
return email;
54+
}
55+
56+
public void setEmail(String email) {
57+
this.email = email;
58+
}
59+
60+
public String getPassword() {
61+
return password;
62+
}
63+
64+
public void setPassword(String password) {
65+
this.password = password;
66+
}
67+
68+
public String getGender() {
69+
return gender;
70+
}
71+
72+
public void setGender(String gender) {
73+
this.gender = gender;
74+
}
75+
76+
public String getDOB() {
77+
return birthdate;
78+
}
79+
80+
public void setDOB(String dOB) {
81+
birthdate = dOB;
82+
}
83+
84+
public String getPhonenumber() {
85+
return phonenumber;
86+
}
87+
88+
public void setPhonenumber(String phonenumber) {
89+
this.phonenumber = phonenumber;
90+
}
91+
92+
public Admin(String email) {
93+
super();
94+
this.email = email;
95+
}
96+
97+
public Admin() {
98+
super();
99+
}
100+
101+
@Override
102+
public String toString() {
103+
return "User [firstName=" + firstName + ", lastName=" + lastName + ", email=" + email + ", password=" + password
104+
+ ", salt=" + salt + ", gender=" + gender + ", phonenumber=" + phonenumber + ", DOB=" + birthdate + "]";
105+
}
106+
107+
108+
109+
110+
111+
112+
113+
}

Furniture_Spring/src/main/java/com/project/model/BufCart.java renamed to Furniture_Spring/src/main/java/com/hiber/model/Bufcart.java

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,38 @@
1-
package com.project.model;
1+
package com.hiber.model;
22

33
import java.io.Serializable;
44

5-
public class BufCart implements Serializable{
6-
String ProductId,ProductName, email, DateAdded,quantity,price;
5+
import javax.persistence.Column;
6+
import javax.persistence.Entity;
7+
import javax.persistence.GeneratedValue;
8+
import javax.persistence.GenerationType;
9+
import javax.persistence.Id;
10+
11+
@Entity
12+
public class Bufcart {
13+
14+
@Id
15+
private int bufcartId;
16+
17+
@Column(nullable = true)
18+
private int orderId;
19+
public int getOrderId() {
20+
return orderId;
21+
}
22+
23+
public int getBufcartId() {
24+
return bufcartId;
25+
}
26+
27+
public void setBufcartId(int bufcartId) {
28+
this.bufcartId = bufcartId;
29+
}
30+
31+
private String ProductId,ProductName, email, DateAdded,quantity,price;
32+
33+
public void setOrderId(int orderId) {
34+
this.orderId = orderId;
35+
}
736

837
public String getProductName() {
938
return ProductName;
@@ -57,7 +86,7 @@ public void setDateAdded(String dateAdded) {
5786

5887

5988

60-
public BufCart(String productId, String productName, String email, String dateAdded, String quantity, String price) {
89+
public Bufcart(String productId, String productName, String email, String dateAdded, String quantity, String price) {
6190
super();
6291
ProductId = productId;
6392
ProductName = productName;
@@ -67,11 +96,11 @@ public BufCart(String productId, String productName, String email, String dateAd
6796
this.price = price;
6897
}
6998

70-
public BufCart() {
99+
public Bufcart() {
71100
super();
72101
}
73102

74-
public BufCart(String email) {
103+
public Bufcart(String email) {
75104
super();
76105
this.email = email;
77106
}

Furniture_Spring/src/main/java/com/project/model/OrderPlaced.java renamed to Furniture_Spring/src/main/java/com/hiber/model/OrderPlaced.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
1-
package com.project.model;
1+
package com.hiber.model;
22

33
import java.io.Serializable;
44

5-
public class OrderPlaced implements Serializable{
5+
import javax.persistence.Entity;
6+
import javax.persistence.Id;
67

7-
String orderId,email,totalCost,orderDate,orderStatus;
8+
@Entity
9+
public class OrderPlaced {
10+
11+
@Id
12+
private int orderId;
13+
private String email,totalCost,orderDate,orderStatus;
814

9-
public String getOrderId() {
15+
public int getOrderId() {
1016
return orderId;
1117
}
1218

13-
public void setOrderId(String orderId) {
19+
public void setOrderId(int orderId) {
1420
this.orderId = orderId;
1521
}
1622

@@ -46,7 +52,7 @@ public void setOrderStatus(String orderStatus) {
4652
this.orderStatus = orderStatus;
4753
}
4854

49-
public OrderPlaced(String orderId, String email, String totalCost, String orderDate, String orderStatus) {
55+
public OrderPlaced(int orderId, String email, String totalCost, String orderDate, String orderStatus) {
5056
super();
5157
this.orderId = orderId;
5258
this.email = email;

0 commit comments

Comments
 (0)