Purpose: Represent a date function: CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP.
Responsibilities:
DateFunctionNode constructor. super();
super();
INTERNAL Apply this node to the passed query if (theQuery.isReportQuery()){ ReportQuery reportQuery = (ReportQuery)theQuery; reportQuery.addAttribute("date", generateExpression(context), type); }
if (theQuery.isReportQuery()){ ReportQuery reportQuery = (ReportQuery)theQuery; reportQuery.addAttribute("date", generateExpression(context), type); }
INTERNAL Generate the TopLink expression for this node Expression expr = context.getBaseExpression(); if (expr == null) { expr = new ExpressionBuilder(); } Expression result = null; if (type == Date.class) { result = expr.currentDateDate(); } else if (type == Time.class) { result = expr.currentTime(); } else if (type == Timestamp.class) { result = expr.currentDate(); } return result;
Expression expr = context.getBaseExpression(); if (expr == null) { expr = new ExpressionBuilder(); } Expression result = null; if (type == Date.class) { result = expr.currentDateDate(); } else if (type == Time.class) { result = expr.currentTime(); } else if (type == Timestamp.class) { result = expr.currentDate(); } return result;
type = Date.class;
type = Time.class;
type = Timestamp.class;
INTERNAL Validate node and calculate its type. setType(type);
setType(type);