Coverage Report - net.taylor.audit.entity.editor.AuditFieldFinderBean
 
Classes in this File Line Coverage Branch Coverage Complexity
AuditFieldFinderBean
44% 
N/A 
0
 
 1  
 /*
 2  
  * ============================================================================
 3  
  *                   GNU Lesser General Public License
 4  
  * ============================================================================
 5  
  *
 6  
  * Taylor - The Java Enterprise Application Framework.
 7  
  * Copyright (C) 2005 John Gilbert jgilbert01@users.sourceforge.net
 8  
  *
 9  
  * This library is free software; you can redistribute it and/or
 10  
  * modify it under the terms of the GNU Lesser General Public
 11  
  * License as published by the Free Software Foundation; either
 12  
  * version 2.1 of the License, or (at your option) any later version.
 13  
  *
 14  
  * This library 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 GNU
 17  
  * Lesser General Public License for more details.
 18  
  *
 19  
  * You should have received a copy of the GNU Lesser General Public
 20  
  * License along with this library; if not, write to the Free Software
 21  
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307, USA.
 22  
  *
 23  
  * John Gilbert
 24  
  * Email: jgilbert01@users.sourceforge.net
 25  
  */
 26  
 package net.taylor.audit.entity.editor;
 27  
 import javax.ejb.Stateful;
 28  
 
 29  
 import net.taylor.audit.entity.AuditField;
 30  
 import net.taylor.richfaces.Picker;
 31  
 import net.taylor.seam.AbstractFinderBean;
 32  
 import net.taylor.seam.ComboBox;
 33  
 import net.taylor.seam.Filter;
 34  
 import net.taylor.seam.PieChart;
 35  
 
 36  
 import org.jboss.seam.ScopeType;
 37  
 import org.jboss.seam.annotations.Name;
 38  
 import org.jboss.seam.annotations.Scope;
 39  
 
 40  
 /**
 41  
  * The implementation of the Finder interface.
 42  
  *
 43  
  * @author jgilbert
 44  
  * @generated
 45  
  */
 46  
 @Name("auditFieldFinder")
 47  
 @Stateful
 48  
 @Scope(ScopeType.SESSION)
 49  
 public class AuditFieldFinderBean extends AbstractFinderBean< AuditField > implements AuditFieldFinder {
 50  
 
 51  
         /** @generated */
 52  
         private static final long serialVersionUID = 1L;
 53  
         
 54  
         /** @generated */
 55  3
         public AuditFieldFinderBean() {
 56  3
                 initOrderBy("name", false);
 57  3
         }
 58  
 
 59  
         /** @generated */
 60  
         protected void initFilter(Filter filter) {
 61  3
                 filter.addStringParameter("name");
 62  3
                 filter.addStringParameter("oldValue");
 63  3
                 filter.addStringParameter("newValue");
 64  3
         }
 65  
         
 66  
         /** @generated */
 67  
         protected void initColumns() {
 68  
                 // addColumn("id", "ID", true);
 69  3
                 addColumn("name", "String", null);
 70  3
                 addColumn("oldValue", "String", null);
 71  3
                 addColumn("newValue", "String", null);
 72  
 
 73  3
         }
 74  
 
 75  
         /** @generated */
 76  
         public boolean isSimpleEntity() {
 77  621
                 return true;
 78  
         }
 79  
 
 80  
         /** @generated */
 81  
         public boolean isRenderView() {
 82  408
                 return false;
 83  
         }
 84  
 
 85  
         /** @NOT generated */
 86  
         public PieChart getEntryPieChart() {        
 87  9
                 return new PieChart(getEntityManager(), "AuditField", "entry.entityName");
 88  
         }
 89  
         
 90  
         public PieChart getNamePieChart() {        
 91  0
                 return new PieChart(getEntityManager(), "AuditField", "name");
 92  
         }
 93  
 
 94  
         /**
 95  
          * ------------------------------------------------------------------------
 96  
          * --- Base ComboBox
 97  
          * ------------------------------------------------------------------------
 98  
          *
 99  
          * @generated
 100  
          */
 101  
         public static class AuditFieldComboBox<COMP, SRC> extends ComboBox<COMP, AuditField, SRC> {
 102  
 
 103  
                 /** @generated */
 104  
                 public AuditFieldComboBox(Object component, String name) {
 105  0
                         super(component, name);
 106  0
                 }
 107  
 
 108  
                 /** @generated */
 109  
                 public AuditFieldComboBox(Object component, String instanceName, String name) {
 110  0
                         super(component, instanceName, name);
 111  0
                 }
 112  
                 
 113  
                 /** @generated */
 114  
                 protected Class getEntityClass() {
 115  0
                         return AuditField.class;
 116  
                 }
 117  
                 
 118  
                 /** @generated */
 119  
                 protected String getAlias() {
 120  0
                         return "t1";
 121  
                 }
 122  
                 
 123  
                 /** @generated */
 124  
                 protected String getItemLabel() {
 125  0
                         return "#{t1.name}";
 126  
                 }
 127  
 
 128  
                 /** @generated */
 129  
                 protected String getOrderBy() {
 130  0
                         return "t1.name";
 131  
                 }
 132  
         }
 133  
         
 134  
         /**
 135  
          * ------------------------------------------------------------------------
 136  
          * --- Base Picker
 137  
          * ------------------------------------------------------------------------
 138  
          *
 139  
          * @generated
 140  
          */
 141  
         public static class AuditFieldPicker<COMP, SRC> extends
 142  
                 Picker<COMP, AuditField, SRC> {
 143  
 
 144  
                 /** @generated */
 145  
                 public AuditFieldPicker(Object component, String name) {
 146  0
                         super(component, name);
 147  0
                 }
 148  
 
 149  
                 /** @generated */
 150  
                 public AuditFieldPicker(Object component, String instanceName, String name) {
 151  0
                         super(component, instanceName, name);
 152  0
                 }
 153  
 
 154  
                 /** @generated */
 155  
                 protected Class getEntityClass() {
 156  0
                         return AuditField.class;
 157  
                 }
 158  
 
 159  
                 /** @generated */
 160  
                 protected String getAlias() {
 161  0
                         return "t1";
 162  
                 }
 163  
                 
 164  
                 /** @generated */
 165  
                 protected String getItemLabel() {
 166  0
                         return "#{t1.name}";
 167  
                 }
 168  
 
 169  
                 /** @generated */
 170  
                 protected String getOrderBy() {
 171  0
                         return "t1.name";
 172  
                 }
 173  
         
 174  
                 /** @generated */
 175  
                 protected String getFilterRestriction() {
 176  0
                         return "lower(t1.name) like :filter";
 177  
                 }
 178  
         }
 179  
 }