1 22 package org.jboss.ejb.plugins.cmp.jdbc.bridge; 23 24 import org.jboss.ejb.EntityEnterpriseContext; 25 import org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager; 26 import org.jboss.ejb.plugins.cmp.jdbc.JDBCTypeFactory; 27 import org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCCMPFieldMetaData; 28 import org.jboss.deployment.DeploymentException; 29 30 35 public class JDBCCMP2xUpdatedTimeFieldBridge extends JDBCCMP2xAutoUpdatedFieldBridge 36 { 37 public JDBCCMP2xUpdatedTimeFieldBridge(JDBCStoreManager manager, 38 JDBCCMPFieldMetaData metadata) 39 throws DeploymentException 40 { 41 super(manager, metadata); 42 checkDirtyAfterGet = false; 43 stateFactory = JDBCTypeFactory.EQUALS; 44 } 45 46 public JDBCCMP2xUpdatedTimeFieldBridge(JDBCCMP2xFieldBridge cmpField) 47 throws DeploymentException 48 { 49 super(cmpField); 50 checkDirtyAfterGet = false; 51 stateFactory = JDBCTypeFactory.EQUALS; 52 } 53 54 public void setFirstVersion(EntityEnterpriseContext ctx) 55 { 56 setInstanceValue(ctx, new java.util.Date ()); 57 } 58 59 public Object updateVersion(EntityEnterpriseContext ctx) 60 { 61 Object value = new java.util.Date (); 62 setInstanceValue(ctx, value); 63 return value; 64 } 65 } 66 | Popular Tags |