Skip to content

Commit ba45dae

Browse files
committed
Merge branch 'dev' into master-merged
# Conflicts: # src/main/java/org/apeps/firstapp/config/CacheConfiguration.java # src/main/resources/config/liquibase/master.xml # src/main/webapp/app/layouts/navbar/navbar.html # src/main/webapp/index.html
2 parents 7ed39a6 + d8f3df8 commit ba45dae

File tree

77 files changed

+4961
-0
lines changed

Some content is hidden

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

77 files changed

+4961
-0
lines changed

.jhipster/Cart.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"fluentMethods": true,
3+
"relationships": [
4+
{
5+
"relationshipType": "one-to-many",
6+
"relationshipName": "item",
7+
"otherEntityName": "item",
8+
"otherEntityRelationshipName": "cart"
9+
},
10+
{
11+
"relationshipType": "one-to-one",
12+
"relationshipName": "customer",
13+
"otherEntityName": "customer",
14+
"ownerSide": false,
15+
"otherEntityRelationshipName": "cart"
16+
}
17+
],
18+
"fields": [],
19+
"changelogDate": "20171208125341",
20+
"entityTableName": "cart",
21+
"dto": "no",
22+
"pagination": "no",
23+
"service": "no",
24+
"jpaMetamodelFiltering": false
25+
}

.jhipster/Category.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"fluentMethods": true,
3+
"relationships": [
4+
{
5+
"relationshipType": "one-to-many",
6+
"relationshipName": "item",
7+
"otherEntityName": "item",
8+
"otherEntityRelationshipName": "category"
9+
},
10+
{
11+
"relationshipType": "many-to-one",
12+
"relationshipName": "parent",
13+
"otherEntityName": "category",
14+
"otherEntityField": "id"
15+
}
16+
],
17+
"fields": [
18+
{
19+
"fieldName": "name",
20+
"fieldType": "String",
21+
"fieldValidateRules": [
22+
"required"
23+
]
24+
}
25+
],
26+
"changelogDate": "20171118104227",
27+
"entityTableName": "category",
28+
"dto": "no",
29+
"pagination": "pagination",
30+
"service": "serviceClass",
31+
"jpaMetamodelFiltering": false
32+
}

.jhipster/Customer.json

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"fluentMethods": true,
3+
"relationships": [
4+
{
5+
"relationshipType": "one-to-one",
6+
"relationshipName": "cart",
7+
"otherEntityName": "cart",
8+
"otherEntityField": "id",
9+
"ownerSide": true,
10+
"otherEntityRelationshipName": "customer"
11+
}
12+
],
13+
"fields": [
14+
{
15+
"fieldName": "firstName",
16+
"fieldType": "String"
17+
},
18+
{
19+
"fieldName": "lastName",
20+
"fieldType": "String"
21+
},
22+
{
23+
"fieldName": "email",
24+
"fieldType": "String"
25+
},
26+
{
27+
"fieldName": "telephone",
28+
"fieldType": "String"
29+
}
30+
],
31+
"changelogDate": "20171118104228",
32+
"entityTableName": "customer",
33+
"dto": "no",
34+
"pagination": "pagination",
35+
"service": "no",
36+
"jpaMetamodelFiltering": false
37+
}

.jhipster/Item.json

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"fluentMethods": true,
3+
"relationships": [
4+
{
5+
"relationshipType": "many-to-one",
6+
"relationshipName": "category",
7+
"otherEntityName": "category",
8+
"otherEntityField": "id"
9+
},
10+
{
11+
"relationshipName": "cart",
12+
"otherEntityName": "cart",
13+
"relationshipType": "many-to-one",
14+
"otherEntityField": "id"
15+
}
16+
],
17+
"fields": [
18+
{
19+
"fieldName": "name",
20+
"fieldType": "String",
21+
"fieldValidateRules": [
22+
"required"
23+
]
24+
},
25+
{
26+
"fieldName": "description",
27+
"fieldType": "String"
28+
},
29+
{
30+
"fieldName": "price",
31+
"fieldType": "Integer"
32+
}
33+
],
34+
"changelogDate": "20171118104226",
35+
"entityTableName": "item",
36+
"dto": "no",
37+
"pagination": "pagination",
38+
"service": "serviceClass",
39+
"jpaMetamodelFiltering": false
40+
}

src/main/java/org/apeps/firstapp/config/CacheConfiguration.java

+8
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ public JCacheManagerCustomizer cacheManagerCustomizer() {
4747
cm.createCache(org.apeps.firstapp.domain.Offering.class.getName() + ".prices", jcacheConfiguration);
4848
cm.createCache(org.apeps.firstapp.domain.Offering.class.getName() + ".childs", jcacheConfiguration);
4949
cm.createCache(org.apeps.firstapp.domain.Price.class.getName(), jcacheConfiguration);
50+
cm.createCache(org.apeps.firstapp.domain.Item.class.getName(), jcacheConfiguration);
51+
cm.createCache(org.apeps.firstapp.domain.Category.class.getName(), jcacheConfiguration);
52+
cm.createCache(org.apeps.firstapp.domain.Category.class.getName() + ".items", jcacheConfiguration);
53+
cm.createCache(org.apeps.firstapp.domain.Customer.class.getName(), jcacheConfiguration);
54+
cm.createCache(org.apeps.firstapp.domain.Customer.class.getName() + ".items", jcacheConfiguration);
55+
cm.createCache(org.apeps.firstapp.domain.Cart.class.getName(), jcacheConfiguration);
56+
cm.createCache(org.apeps.firstapp.domain.Cart.class.getName() + ".items", jcacheConfiguration);
57+
5058
// jhipster-needle-ehcache-add-entry
5159
};
5260
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
package org.apeps.firstapp.domain;
2+
3+
import com.fasterxml.jackson.annotation.JsonIgnore;
4+
import org.hibernate.annotations.Cache;
5+
import org.hibernate.annotations.CacheConcurrencyStrategy;
6+
7+
import javax.persistence.*;
8+
import java.io.Serializable;
9+
import java.util.HashSet;
10+
import java.util.Set;
11+
import java.util.Objects;
12+
13+
/**
14+
* A Cart.
15+
*/
16+
@Entity
17+
@Table(name = "cart")
18+
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
19+
public class Cart implements Serializable {
20+
21+
private static final long serialVersionUID = 1L;
22+
23+
@Id
24+
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
25+
@SequenceGenerator(name = "sequenceGenerator")
26+
private Long id;
27+
28+
@OneToMany(mappedBy = "cart")
29+
@JsonIgnore
30+
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
31+
private Set<Item> items = new HashSet<>();
32+
33+
@OneToOne(mappedBy = "cart")
34+
@JsonIgnore
35+
private Customer customer;
36+
37+
// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
38+
public Long getId() {
39+
return id;
40+
}
41+
42+
public void setId(Long id) {
43+
this.id = id;
44+
}
45+
46+
public Set<Item> getItems() {
47+
return items;
48+
}
49+
50+
public Cart items(Set<Item> items) {
51+
this.items = items;
52+
return this;
53+
}
54+
55+
public Cart addItem(Item item) {
56+
this.items.add(item);
57+
item.setCart(this);
58+
return this;
59+
}
60+
61+
public Cart removeItem(Item item) {
62+
this.items.remove(item);
63+
item.setCart(null);
64+
return this;
65+
}
66+
67+
public void setItems(Set<Item> items) {
68+
this.items = items;
69+
}
70+
71+
public Customer getCustomer() {
72+
return customer;
73+
}
74+
75+
public Cart customer(Customer customer) {
76+
this.customer = customer;
77+
return this;
78+
}
79+
80+
public void setCustomer(Customer customer) {
81+
this.customer = customer;
82+
}
83+
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove
84+
85+
@Override
86+
public boolean equals(Object o) {
87+
if (this == o) {
88+
return true;
89+
}
90+
if (o == null || getClass() != o.getClass()) {
91+
return false;
92+
}
93+
Cart cart = (Cart) o;
94+
if (cart.getId() == null || getId() == null) {
95+
return false;
96+
}
97+
return Objects.equals(getId(), cart.getId());
98+
}
99+
100+
@Override
101+
public int hashCode() {
102+
return Objects.hashCode(getId());
103+
}
104+
105+
@Override
106+
public String toString() {
107+
return "Cart{" +
108+
"id=" + getId() +
109+
"}";
110+
}
111+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
package org.apeps.firstapp.domain;
2+
3+
import com.fasterxml.jackson.annotation.JsonIgnore;
4+
import org.hibernate.annotations.Cache;
5+
import org.hibernate.annotations.CacheConcurrencyStrategy;
6+
7+
import javax.persistence.*;
8+
import javax.validation.constraints.*;
9+
import java.io.Serializable;
10+
import java.util.HashSet;
11+
import java.util.Set;
12+
import java.util.Objects;
13+
14+
/**
15+
* A Category.
16+
*/
17+
@Entity
18+
@Table(name = "category")
19+
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
20+
public class Category implements Serializable {
21+
22+
private static final long serialVersionUID = 1L;
23+
24+
@Id
25+
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
26+
@SequenceGenerator(name = "sequenceGenerator")
27+
private Long id;
28+
29+
@NotNull
30+
@Column(name = "name", nullable = false)
31+
private String name;
32+
33+
@OneToMany(mappedBy = "category")
34+
@JsonIgnore
35+
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
36+
private Set<Item> items = new HashSet<>();
37+
38+
@ManyToOne
39+
private Category parent;
40+
41+
// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
42+
public Long getId() {
43+
return id;
44+
}
45+
46+
public void setId(Long id) {
47+
this.id = id;
48+
}
49+
50+
public String getName() {
51+
return name;
52+
}
53+
54+
public Category name(String name) {
55+
this.name = name;
56+
return this;
57+
}
58+
59+
public void setName(String name) {
60+
this.name = name;
61+
}
62+
63+
public Set<Item> getItems() {
64+
return items;
65+
}
66+
67+
public Category items(Set<Item> items) {
68+
this.items = items;
69+
return this;
70+
}
71+
72+
public Category addItem(Item item) {
73+
this.items.add(item);
74+
item.setCategory(this);
75+
return this;
76+
}
77+
78+
public Category removeItem(Item item) {
79+
this.items.remove(item);
80+
item.setCategory(null);
81+
return this;
82+
}
83+
84+
public void setItems(Set<Item> items) {
85+
this.items = items;
86+
}
87+
88+
public Category getParent() {
89+
return parent;
90+
}
91+
92+
public Category parent(Category category) {
93+
this.parent = category;
94+
return this;
95+
}
96+
97+
public void setParent(Category category) {
98+
this.parent = category;
99+
}
100+
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove
101+
102+
@Override
103+
public boolean equals(Object o) {
104+
if (this == o) {
105+
return true;
106+
}
107+
if (o == null || getClass() != o.getClass()) {
108+
return false;
109+
}
110+
Category category = (Category) o;
111+
if (category.getId() == null || getId() == null) {
112+
return false;
113+
}
114+
return Objects.equals(getId(), category.getId());
115+
}
116+
117+
@Override
118+
public int hashCode() {
119+
return Objects.hashCode(getId());
120+
}
121+
122+
@Override
123+
public String toString() {
124+
return "Category{" +
125+
"id=" + getId() +
126+
", name='" + getName() + "'" +
127+
"}";
128+
}
129+
}

0 commit comments

Comments
 (0)