svn-gvsig-desktop / trunk / libraries / libGDBMS / src / com / hardcode / gdbms / engine / instruction / TableRefAdapter.java @ 466
History | View | Annotate | Download (1.04 KB)
1 |
/*
|
---|---|
2 |
* Created on 12-oct-2004
|
3 |
*/
|
4 |
package com.hardcode.gdbms.engine.instruction; |
5 |
|
6 |
import com.hardcode.gdbms.parser.Node; |
7 |
import com.hardcode.gdbms.parser.SimpleNode; |
8 |
|
9 |
|
10 |
/**
|
11 |
* Adaptador
|
12 |
*
|
13 |
* @author Fernando Gonz?lez Cort?s
|
14 |
*/
|
15 |
public class TableRefAdapter extends Adapter { |
16 |
private String name; |
17 |
private String alias; |
18 |
|
19 |
/**
|
20 |
* @see com.hardcode.gdbms.engine.instruction.Adapter#setEntity(com.hardcode.gdbms.parser.Node)
|
21 |
*/
|
22 |
public void setEntity(Node o) { |
23 |
super.setEntity(o);
|
24 |
|
25 |
String text = Utilities.getText((SimpleNode) o); |
26 |
|
27 |
String[] tabla = text.split(" "); |
28 |
|
29 |
if (tabla.length == 1) { |
30 |
name = tabla[0];
|
31 |
} else {
|
32 |
name = tabla[0];
|
33 |
alias = tabla[1];
|
34 |
} |
35 |
} |
36 |
|
37 |
/**
|
38 |
* Obtiene el akias de la tabla
|
39 |
*
|
40 |
* @return Returns the alias.
|
41 |
*/
|
42 |
public String getAlias() { |
43 |
return alias;
|
44 |
} |
45 |
|
46 |
/**
|
47 |
* Obtiene el nombre de la tabla
|
48 |
*
|
49 |
* @return Returns the name.
|
50 |
*/
|
51 |
public String getName() { |
52 |
return name;
|
53 |
} |
54 |
} |