View Javadoc
1   package fr.ifremer.quadrige2.core.dao.administration.program;
2   
3   /*-
4    * #%L
5    * Quadrige2 Core :: Quadrige2 Server Core
6    * $Id:$
7    * $HeadURL:$
8    * %%
9    * Copyright (C) 2017 Ifremer
10   * %%
11   * This program is free software: you can redistribute it and/or modify
12   * it under the terms of the GNU Affero General Public License as published by
13   * the Free Software Foundation, either version 3 of the License, or
14   * (at your option) any later version.
15   * 
16   * This program is distributed in the hope that it will be useful,
17   * but WITHOUT ANY WARRANTY; without even the implied warranty of
18   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19   * GNU General Public License for more details.
20   * 
21   * You should have received a copy of the GNU Affero General Public License
22   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
23   * #L%
24   */
25  import org.hibernate.SessionFactory;
26  import org.springframework.beans.factory.annotation.Autowired;
27  import org.springframework.context.annotation.Lazy;
28  import org.springframework.stereotype.Repository;
29  
30  /**
31   * <p>
32   * ProgramPrivilegeDaoImpl class.
33   * </p>
34   * 
35   * @see ProgramPrivilege
36   */
37  @Repository("programPrivilegeDao")
38  @Lazy
39  public class ProgramPrivilegeDaoImpl
40  		extends ProgramPrivilegeDaoBase
41  {
42  	/**
43  	 * Constructor used by Spring
44  	 * 
45  	 * @param sessionFactory
46  	 *            a {@link org.hibernate.SessionFactory} object.
47  	 */
48  	@Autowired
49  	public ProgramPrivilegeDaoImpl(SessionFactory sessionFactory) {
50  		super();
51  		setSessionFactory(sessionFactory);
52  	}
53  
54  	/** {@inheritDoc} */
55  	public void toProgramPrivilegeIds(
56  			ProgramPrivilege source,
57  			ProgramPrivilegeIds target){
58  		// TODO verify behavior of toProgramPrivilegeIds
59  		super.toProgramPrivilegeIds(source, target);
60  	}
61  
62  	/** {@inheritDoc} */
63  	public ProgramPrivilegeIds toProgramPrivilegeIds(final ProgramPrivilege entity)
64  	{
65  		// TODO verify behavior of toProgramPrivilegeIds
66  		return super.toProgramPrivilegeIds(entity);
67  	}
68  
69  	/**
70  	 * Retrieves the entity object that is associated with the specified value object
71  	 * from the object store. If no such entity object exists in the object store,
72  	 * a new, blank entity is created
73  	 */
74  	private ProgramPrivilege loadProgramPrivilegeFromProgramPrivilegeIds(ProgramPrivilegeIds programPrivilegeIds)
75  	{
76  		// TODO implement loadProgramPrivilegeFromProgramPrivilegeIds
77  		throw new UnsupportedOperationException(
78  				"fr.ifremer.quadrige2.core.dao.administration.program.loadProgramPrivilegeFromProgramPrivilegeIds(ProgramPrivilegeIds) not yet implemented.");
79  
80  		/*
81  		 * A typical implementation looks like this:
82  		 * ProgramPrivilege programPrivilege = this.get(programPrivilegeIds.getId());
83  		 * if (programPrivilege == null)
84  		 * {
85  		 * programPrivilege = ProgramPrivilege.Factory.newInstance();
86  		 * }
87  		 * return programPrivilege;
88  		 */
89  	}
90  
91  	/** {@inheritDoc} */
92  	public ProgramPrivilege programPrivilegeIdsToEntity(ProgramPrivilegeIds programPrivilegeIds)
93  	{
94  		// TODO verify behavior of programPrivilegeIdsToEntity
95  		ProgramPrivilege entity = this.loadProgramPrivilegeFromProgramPrivilegeIds(programPrivilegeIds);
96  		this.programPrivilegeIdsToEntity(programPrivilegeIds, entity, true);
97  		return entity;
98  	}
99  
100 	/** {@inheritDoc} */
101 	@Override
102 	public void programPrivilegeIdsToEntity(
103 			ProgramPrivilegeIds source,
104 			ProgramPrivilege target,
105 			boolean copyIfNull)
106 	{
107 		// TODO verify behavior of programPrivilegeIdsToEntity
108 		super.programPrivilegeIdsToEntity(source, target, copyIfNull);
109 	}
110 }