From ad0e368eeedb0454e1dd398bd84c23cbfbd692f8 Mon Sep 17 00:00:00 2001 From: lresende Date: Mon, 2 Nov 2009 22:23:40 +0000 Subject: Moving das tags git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@832150 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/webapp/jsp/converter.jsp | 117 +++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 das-java/tags/1.0-incubating-beta1-rc4/samples/sample-ajax-das/src/main/webapp/jsp/converter.jsp (limited to 'das-java/tags/1.0-incubating-beta1-rc4/samples/sample-ajax-das/src/main/webapp/jsp/converter.jsp') diff --git a/das-java/tags/1.0-incubating-beta1-rc4/samples/sample-ajax-das/src/main/webapp/jsp/converter.jsp b/das-java/tags/1.0-incubating-beta1-rc4/samples/sample-ajax-das/src/main/webapp/jsp/converter.jsp new file mode 100644 index 0000000000..a3610e7639 --- /dev/null +++ b/das-java/tags/1.0-incubating-beta1-rc4/samples/sample-ajax-das/src/main/webapp/jsp/converter.jsp @@ -0,0 +1,117 @@ + + +<%-- + * Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + --%> + +<%-- JSTL tags --%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> + + + + + + + + + + + +<%@ page import="java.util.*" %> + + + +
+ + + + + + + +Arbitrary Converter: + The column converted is a VARCAHAR. + ResultSetShape is used to specify that the property will be a SDODataTypes.DATE. + So this example uses a converter that transforms a string column into a date property + and conversely, a date property back to a string for the underlying column. +
+ The converter returns 1957.09.27 if the column value is "Pavick" and 1966.12.20 if + the value is "Williams" +
+ On write, the converter returns "Williams" if the property value is 1966.12.20 and "Pavick" + if the property value is 1957.09.27 +
+ Check using direct database connection that the database table rows's column values are + either "Williams" or "Pavick". +
+
+ +Select * from CUSTOMER where ID = 1; +
+ +Check First Customer's LastName is 1957.09.27 +
+ +Set First Customer's LastName to 1966.12.20 +
+ +Check First Customer's LastName is 1966.12.20 +
+ + +    + + +
+ + + +
 
+
+ + +
+ +
+ + + -- cgit v1.2.3