svn-gvsig-desktop / trunk / libraries / libGDBMS / src / com / hardcode / gdbms / engine / instruction / SelectColsAdapter.java @ 466
History | View | Annotate | Download (1.22 KB)
1 |
/*
|
---|---|
2 |
* Created on 12-oct-2004
|
3 |
*/
|
4 |
package com.hardcode.gdbms.engine.instruction; |
5 |
|
6 |
/**
|
7 |
* Adaptador
|
8 |
*
|
9 |
* @author Fernando Gonz?lez Cort?s
|
10 |
*/
|
11 |
public class SelectColsAdapter extends Adapter { |
12 |
private String text; |
13 |
|
14 |
/**
|
15 |
* Devuelve si se utiliz? el modificado DISTINCT
|
16 |
*
|
17 |
* @return boolean
|
18 |
*/
|
19 |
public boolean isDistinct() { |
20 |
String text = Utilities.getText(getEntity()); |
21 |
|
22 |
if (text.trim().startsWith("distinct")) { |
23 |
return true; |
24 |
} else {
|
25 |
return false; |
26 |
} |
27 |
} |
28 |
|
29 |
/**
|
30 |
* Obtiene las expresiones de los campos
|
31 |
*
|
32 |
* @return
|
33 |
*/
|
34 |
public Expression[] getFieldsExpression() { |
35 |
String text = Utilities.getText(getEntity()).trim(); |
36 |
|
37 |
if (text.endsWith("*")) { |
38 |
return null; |
39 |
} else {
|
40 |
return ((SelectListAdapter) getChilds()[0]).getFieldsExpression(); |
41 |
} |
42 |
} |
43 |
|
44 |
/**
|
45 |
* Obtiene los alias de los campos
|
46 |
*
|
47 |
* @return
|
48 |
*/
|
49 |
public String[] getFieldsAlias() { |
50 |
String text = Utilities.getText(getEntity()).trim(); |
51 |
|
52 |
if (text.endsWith("*")) { |
53 |
return null; |
54 |
} else {
|
55 |
return ((SelectListAdapter) getChilds()[0]).getFieldsAlias(); |
56 |
} |
57 |
} |
58 |
} |