View Javadoc
1   package fr.ifremer.quadrige3.core.dao.administration.program;
2   
3   /*-
4    * #%L
5    * Quadrige3 Core :: Quadrige3 Client 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  	{
59  		// TODO verify behavior of toProgramPrivilegeIds
60  		super.toProgramPrivilegeIds(source, target);
61  	}
62  
63  	/** {@inheritDoc} */
64  	public ProgramPrivilegeIds toProgramPrivilegeIds(final ProgramPrivilege entity)
65  	{
66  		// TODO verify behavior of toProgramPrivilegeIds
67  		return super.toProgramPrivilegeIds(entity);
68  	}
69  
70  	/**
71  	 * Retrieves the entity object that is associated with the specified value object
72  	 * from the object store. If no such entity object exists in the object store,
73  	 * a new, blank entity is created
74  	 */
75  	private ProgramPrivilege loadProgramPrivilegeFromProgramPrivilegeIds(ProgramPrivilegeIds programPrivilegeIds)
76  	{
77  		// TODO implement loadProgramPrivilegeFromProgramPrivilegeIds
78  		throw new UnsupportedOperationException(
79  				"fr.ifremer.quadrige3.core.dao.administration.program.loadProgramPrivilegeFromProgramPrivilegeIds(ProgramPrivilegeIds) not yet implemented.");
80  
81  		/*
82  		 * A typical implementation looks like this:
83  		 * ProgramPrivilege programPrivilege = this.get(programPrivilegeIds.getId());
84  		 * if (programPrivilege == null)
85  		 * {
86  		 * programPrivilege = ProgramPrivilege.Factory.newInstance();
87  		 * }
88  		 * return programPrivilege;
89  		 */
90  	}
91  
92  	/** {@inheritDoc} */
93  	public ProgramPrivilege programPrivilegeIdsToEntity(ProgramPrivilegeIds programPrivilegeIds)
94  	{
95  		// TODO verify behavior of programPrivilegeIdsToEntity
96  		ProgramPrivilege entity = this.loadProgramPrivilegeFromProgramPrivilegeIds(programPrivilegeIds);
97  		this.programPrivilegeIdsToEntity(programPrivilegeIds, entity, true);
98  		return entity;
99  	}
100 
101 	/** {@inheritDoc} */
102 	@Override
103 	public void programPrivilegeIdsToEntity(
104 			ProgramPrivilegeIds source,
105 			ProgramPrivilege target,
106 			boolean copyIfNull)
107 	{
108 		// TODO verify behavior of programPrivilegeIdsToEntity
109 		super.programPrivilegeIdsToEntity(source, target, copyIfNull);
110 	}
111 }