"reference" is an element attribute, not property.
This commit is contained in:
parent
7623372601
commit
7d4f9afb08
|
@ -44,7 +44,7 @@ public class ReferenceUtils {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isLookup(Element element)
|
public static boolean isLookup(Element element)
|
||||||
{
|
{
|
||||||
if (isIDLookup(element) || isUUIDLookup(element) || isTableLookup(element))
|
if (isIDLookup(element) || isUUIDLookup(element) || isTableLookup(element))
|
||||||
|
@ -52,23 +52,23 @@ public class ReferenceUtils {
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isIDLookup(Element element)
|
public static boolean isIDLookup(Element element)
|
||||||
{
|
{
|
||||||
return "id".equals(element.properties.get("reference"));
|
return "id".equals(element.attributes.getValue("reference"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isUUIDLookup(Element element)
|
public static boolean isUUIDLookup(Element element)
|
||||||
{
|
{
|
||||||
return "uuid".equals(element.properties.get("reference"));
|
return "uuid".equals(element.attributes.getValue("reference"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isTableLookup(Element element)
|
public static boolean isTableLookup(Element element)
|
||||||
{
|
{
|
||||||
return "table".equals(element.properties.get("reference"));
|
return "table".equals(element.attributes.getValue("reference"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getTableReference(String tableName, String searchColumn, int id, AttributesImpl atts)
|
public static String getTableReference(String tableName, String searchColumn, int id, AttributesImpl atts)
|
||||||
{
|
{
|
||||||
String keyColumn = tableName + "_ID";
|
String keyColumn = tableName + "_ID";
|
||||||
String sql = "SELECT " + searchColumn + " FROM "
|
String sql = "SELECT " + searchColumn + " FROM "
|
||||||
|
@ -99,7 +99,7 @@ public class ReferenceUtils {
|
||||||
return value.trim();
|
return value.trim();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String value = DB.getSQLValueString(null, sql, id);
|
String value = DB.getSQLValueString(null, sql, id);
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
buffer.append(tableName).append(".").append(searchColumn);
|
buffer.append(tableName).append(".").append(searchColumn);
|
||||||
|
@ -109,5 +109,5 @@ public class ReferenceUtils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue