Skip to content

Commit 461caa8

Browse files
committed
Registration Daos
1 parent b32786a commit 461caa8

2 files changed

Lines changed: 47 additions & 0 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.devnexus.ting.core.dao;
2+
3+
import com.devnexus.ting.core.model.registration.EventSignup;
4+
5+
public interface EventSignupDao {
6+
7+
EventSignup getByEventKey(Long eventId);
8+
9+
10+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright 2002-2011 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.devnexus.ting.core.dao.jpa;
17+
18+
import com.devnexus.ting.core.dao.EventSignupDao;
19+
import com.devnexus.ting.core.model.registration.EventSignup;
20+
21+
public class EventSignupDaoJpa extends GenericDaoJpa< EventSignup, Long>
22+
implements EventSignupDao {
23+
24+
public EventSignupDaoJpa(Class<EventSignup> persistentClass) {
25+
super(EventSignup.class);
26+
}
27+
28+
@Override
29+
public EventSignup getByEventKey(Long eventId) {
30+
return super.entityManager.createQuery("select es from EventSignup es "
31+
+ " join es.event e "
32+
+ "where e.id = :eventKey", EventSignup.class)
33+
.setParameter("eventKey", eventId)
34+
.getSingleResult();
35+
}
36+
37+
}

0 commit comments

Comments
 (0)