View Javadoc
1   /*
2    * #%L
3    * ToPIA :: Persistence
4    * $Id$
5    * $HeadURL$
6    * %%
7    * Copyright (C) 2004 - 2014 CodeLutin
8    * %%
9    * This program is free software: you can redistribute it and/or modify
10   * it under the terms of the GNU Lesser General Public License as 
11   * published by the Free Software Foundation, either version 3 of the 
12   * License, or (at your option) any later version.
13   * 
14   * This program is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   * GNU General Lesser Public License for more details.
18   * 
19   * You should have received a copy of the GNU General Lesser Public 
20   * License along with this program.  If not, see
21   * <http://www.gnu.org/licenses/lgpl-3.0.html>.
22   * #L%
23   */
24  
25  package org.nuiton.topia.generator;
26  
27  import org.codehaus.plexus.component.annotations.Component;
28  import org.nuiton.eugene.Template;
29  import org.nuiton.eugene.java.ObjectModelTransformerToJava;
30  import org.nuiton.eugene.models.object.ObjectModelClass;
31  
32  /*{generator option: parentheses = false}*/
33  
34  /*{generator option: writeString = +}*/
35  /**
36   * Created: 13 déc. 2009
37   *
38   * @author tchemit &lt;chemit@codelutin.com&gt;
39   * @version $Id$
40   * @since 2.3.0
41   * @deprecated 2.5.4, prefer use the transformer {@link EntityDAOTransformer}
42   */
43  @Deprecated
44  @Component(role = Template.class, hint = "org.nuiton.topia.generator.DAOTransformer")
45  public class DAOTransformer extends ObjectModelTransformerToJava {
46  
47      @Override
48      public void transformFromClass(ObjectModelClass clazz) {
49          if (!TopiaGeneratorUtil.isEntity(clazz)) {
50              return;
51          }
52          String clazzName = clazz.getName();
53          String clazzFQN = clazz.getQualifiedName();
54          ObjectModelClass result = createClass(clazzName + "DAO", clazz.getPackageName());
55          setDocumentation(result, "/**\n" +
56                                   " * Cette classe etend le DAOImpl pour parametrer la classe avec le bon type\n" +
57                                   " * Cette classe est marque finale car l'heritage entre les DAO se fait\n" +
58                                   " * sur les DOAImpl, c-a-d que DAOAbstract peut etendre le DAOImpl\n" +
59                                   " */");
60          setSuperClass(result, clazzFQN + "DAOImpl<" + clazzName + ">");
61      }
62  
63  
64  }