SqlTimestampFieldMapping.java

00001 
00026 package org.objectweb.jonas_ejb.lib;
00027 
00033 public class SqlTimestampFieldMapping {
00034 
00039     public static Class getStorageType() {
00040         return java.util.Date.class;
00041     }
00042 
00047     public static Class getMemoryType() {
00048         return java.sql.Timestamp.class;
00049     }
00050 
00056     public static Object toMemory(Object storagevalue) {
00057         if (storagevalue == null) {
00058             return null;
00059         }
00060         return (storagevalue instanceof java.sql.Timestamp
00061                 ? storagevalue
00062                 : new java.sql.Timestamp(((java.util.Date) storagevalue).getTime()));
00063     }
00064 
00070     public static Object toStorage(Object memoryvalue) {
00071         return memoryvalue;
00072     }
00073 }

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