SqlDateFieldMapping.java

00001 
00027 package org.objectweb.jonas_ejb.lib;
00028 
00034 public class SqlDateFieldMapping {
00035 
00040     public static Class getStorageType() {
00041         return java.util.Date.class;
00042     }
00043 
00048     public static Class getMemoryType() {
00049         return java.sql.Date.class;
00050     }
00051 
00057     public static Object toMemory(Object storagevalue) {
00058         if (storagevalue == null) {
00059             return null;
00060         }
00061         return (storagevalue instanceof java.sql.Date
00062                 ? storagevalue
00063                 : new java.sql.Date(((java.util.Date) storagevalue).getTime()));
00064     }
00065 
00071     public static Object toStorage(Object memoryvalue) {
00072         return memoryvalue;
00073     }
00074 }

Generated on Tue Feb 15 15:05:49 2005 for JOnAS by  doxygen 1.3.9.1