Skip to content

Commit d798c67

Browse files
committed
Updating Registration to match spring updates
1 parent 412f52c commit d798c67

9 files changed

Lines changed: 50 additions & 44 deletions

File tree

src/main/java/com/devnexus/ting/core/dao/EventSignupDao.java

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/main/java/com/devnexus/ting/core/model/registration/EventSignup.java renamed to src/main/java/com/devnexus/ting/model/EventSignup.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package com.devnexus.ting.core.model.registration;
1+
package com.devnexus.ting.model;
22

3-
import com.devnexus.ting.core.model.BaseModelObject;
4-
import com.devnexus.ting.core.model.Event;
3+
import com.devnexus.ting.model.BaseModelObject;
4+
import com.devnexus.ting.model.Event;
55
import java.util.HashSet;
66
import java.util.Set;
77
import javax.persistence.Cacheable;
@@ -18,8 +18,6 @@
1818
import org.hibernate.annotations.CacheConcurrencyStrategy;
1919

2020
@Entity
21-
@Cacheable()
22-
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) //, include="non-lazy"
2321
@XmlRootElement
2422
@XmlAccessorType(XmlAccessType.FIELD)
2523
public class EventSignup extends BaseModelObject {

src/main/java/com/devnexus/ting/core/model/registration/PurchaseGroup.java renamed to src/main/java/com/devnexus/ting/model/PurchaseGroup.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package com.devnexus.ting.core.model.registration;
1+
package com.devnexus.ting.model;
22

3-
import com.devnexus.ting.core.model.BaseModelObject;
4-
import com.devnexus.ting.core.model.Event;
3+
import com.devnexus.ting.model.BaseModelObject;
4+
import com.devnexus.ting.model.Event;
55
import java.util.HashSet;
66
import java.util.Set;
77
import javax.persistence.Cacheable;
@@ -17,7 +17,6 @@
1717
import javax.xml.bind.annotation.XmlTransient;
1818
import org.hibernate.annotations.Cache;
1919
import org.hibernate.annotations.CacheConcurrencyStrategy;
20-
import org.hibernate.annotations.Cascade;
2120
import org.hibernate.validator.constraints.NotEmpty;
2221

2322
/**
@@ -26,8 +25,6 @@
2625
* @author summers
2726
*/
2827
@Entity
29-
@Cacheable()
30-
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) //, include="non-lazy"
3128
@XmlRootElement
3229
@XmlAccessorType(XmlAccessType.FIELD)
3330
public class PurchaseGroup extends BaseModelObject {

src/main/java/com/devnexus/ting/core/model/registration/PurchaseItem.java renamed to src/main/java/com/devnexus/ting/model/PurchaseItem.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
package com.devnexus.ting.core.model.registration;
1+
package com.devnexus.ting.model;
22

3-
import com.devnexus.ting.core.model.BaseModelObject;
4-
import com.devnexus.ting.core.model.Event;
3+
4+
import com.devnexus.ting.model.BaseModelObject;
5+
import com.devnexus.ting.model.Event;
56
import java.math.BigDecimal;
67
import java.util.Date;
78
import javax.persistence.Cacheable;
@@ -20,8 +21,6 @@
2021
import org.hibernate.validator.constraints.NotEmpty;
2122

2223
@Entity
23-
@Cacheable()
24-
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) //, include="non-lazy"
2524
@XmlRootElement
2625
@XmlAccessorType(XmlAccessType.FIELD)
2726
public class PurchaseItem extends BaseModelObject {
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.devnexus.ting.repository;
2+
3+
import com.devnexus.ting.model.EventSignup;
4+
import com.devnexus.ting.repository.BaseRepository;
5+
6+
public interface EventSignupRepository extends BaseRepository<EventSignup, Long>, EventSignupRepositoryCustom {
7+
8+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.devnexus.ting.repository;
2+
3+
import com.devnexus.ting.model.EventSignup;
4+
5+
public interface EventSignupRepositoryCustom {
6+
7+
EventSignup getByEventKey(String eventKey);
8+
9+
10+
}

src/main/java/com/devnexus/ting/core/dao/jpa/EventSignupDaoJpa.java renamed to src/main/java/com/devnexus/ting/repository/jpa/EventSignupRepositoryImpl.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,26 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package com.devnexus.ting.core.dao.jpa;
16+
package com.devnexus.ting.repository.jpa;
1717

18-
import com.devnexus.ting.core.dao.EventSignupDao;
19-
import com.devnexus.ting.core.model.registration.EventSignup;
18+
import com.devnexus.ting.repository.EventSignupRepositoryCustom;
19+
import com.devnexus.ting.model.EventSignup;
20+
import javax.persistence.EntityManager;
21+
import javax.persistence.PersistenceContext;
2022
import org.springframework.stereotype.Repository;
2123

2224
@Repository("eventSignupDao")
23-
public class EventSignupDaoJpa extends GenericDaoJpa< EventSignup, Long>
24-
implements EventSignupDao {
25+
public class EventSignupRepositoryImpl
26+
implements EventSignupRepositoryCustom {
27+
28+
29+
@PersistenceContext
30+
private EntityManager entityManager;
2531

26-
public EventSignupDaoJpa() {
27-
super(EventSignup.class);
28-
}
2932

3033
@Override
3134
public EventSignup getByEventKey(String eventKey) {
32-
return super.entityManager.createQuery("select es from EventSignup es "
35+
return entityManager.createQuery("select es from EventSignup es "
3336
+ " join es.event e "
3437
+ "where e.eventKey = :eventKey", EventSignup.class)
3538
.setParameter("eventKey", eventKey)

src/main/java/com/devnexus/ting/web/config/PersistenceConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ public Jaxb2Marshaller jaxbMarshaller() {
7373
com.devnexus.ting.model.ScheduleItemType.class,
7474
com.devnexus.ting.model.CfpSubmission.class,
7575
com.devnexus.ting.model.CfpSubmissionList.class,
76-
com.devnexus.ting.core.model.registration.PurchaseGroup.class,
77-
com.devnexus.ting.core.model.registration.PurchaseItem.class
76+
com.devnexus.ting.model.PurchaseGroup.class,
77+
com.devnexus.ting.model.PurchaseItem.class
7878
);
7979
return jaxbMarshaller;
8080
}

src/test/java/com/devnexus/ting/core/dao/EventSignupDaoTest.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@
1515
*/
1616
package com.devnexus.ting.core.dao;
1717

18-
import com.devnexus.ting.core.model.Event;
19-
import com.devnexus.ting.core.model.registration.EventSignup;
20-
import com.devnexus.ting.core.model.registration.PurchaseGroup;
21-
import com.devnexus.ting.core.model.registration.PurchaseItem;
18+
import com.devnexus.ting.repository.EventSignupRepository;
19+
import com.devnexus.ting.model.EventSignup;
20+
import com.devnexus.ting.model.PurchaseGroup;
21+
import com.devnexus.ting.model.PurchaseItem;
22+
import com.devnexus.ting.model.Event;
23+
import com.devnexus.ting.repository.EventRepository;
2224
import java.math.BigDecimal;
2325
import java.util.Date;
2426
import org.apache.commons.lang.time.DateUtils;
@@ -30,8 +32,8 @@
3032

3133
public class EventSignupDaoTest extends BaseDaoIntegrationTest {
3234

33-
@Autowired EventSignupDao signupDao;
34-
@Autowired EventDao eventDao;
35+
@Autowired EventSignupRepository signupDao;
36+
@Autowired EventRepository eventDao;
3537

3638
@Test
3739
public void save() {

0 commit comments

Comments
 (0)