1 25 26 27 package org.objectweb.jonas_ejb.lib; 28 29 34 public class SqlDateFieldMapping { 35 36 40 public static Class getStorageType() { 41 return java.util.Date .class; 42 } 43 44 48 public static Class getMemoryType() { 49 return java.sql.Date .class; 50 } 51 52 57 public static Object toMemory(Object storagevalue) { 58 if (storagevalue == null) { 59 return null; 60 } 61 return (storagevalue instanceof java.sql.Date  62 ? storagevalue 63 : new java.sql.Date (((java.util.Date ) storagevalue).getTime())); 64 } 65 66 71 public static Object toStorage(Object memoryvalue) { 72 return memoryvalue; 73 } 74 } 75 | Popular Tags |