1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.tools.servicebuilder;
16  
17  import java.util.List;
18  
19  /**
20   * <a href="EntityFinder.java.html"><b><i>View Source</i></b></a>
21   *
22   * @author Brian Wing Shun Chan
23   */
24  public class EntityFinder {
25  
26      public EntityFinder(
27          String name, String returnType, boolean unique, String where,
28          boolean dbIndex, List<EntityColumn> columns) {
29  
30          _name = name;
31          _returnType = returnType;
32          _unique = unique;
33          _where = where;
34          _dbIndex = dbIndex;
35          _columns = columns;
36      }
37  
38      public List<EntityColumn> getColumns() {
39          return _columns;
40      }
41  
42      public String getName() {
43          return _name;
44      }
45  
46      public String getReturnType() {
47          return _returnType;
48      }
49  
50      public String getWhere() {
51          return _where;
52      }
53  
54      public boolean isCollection() {
55          if ((_returnType != null) && _returnType.equals("Collection")) {
56              return true;
57          }
58          else {
59              return false;
60          }
61      }
62  
63      public boolean isDBIndex() {
64          return _dbIndex;
65      }
66  
67      public boolean isUnique() {
68          return _unique;
69      }
70  
71      private List<EntityColumn> _columns;
72      private boolean _dbIndex;
73      private String _name;
74      private String _returnType;
75      private boolean _unique;
76      private String _where;
77  
78  }