File tree Expand file tree Collapse file tree
src/main/java/com/devnexus/ting/core/dao Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments