1 29 30 package com.caucho.amber.type; 31 32 import com.caucho.amber.AmberRuntimeException; 33 import com.caucho.amber.entity.Embeddable; 34 import com.caucho.amber.manager.AmberConnection; 35 import com.caucho.amber.manager.AmberPersistenceUnit; 36 import com.caucho.amber.table.Table; 37 import com.caucho.util.L10N; 38 39 import java.sql.ResultSet ; 40 import java.sql.SQLException ; 41 import java.util.logging.Logger ; 42 43 46 public class EmbeddableType extends AbstractStatefulType { 47 private static final Logger log = Logger.getLogger(EmbeddableType.class.getName()); 48 private static final L10N L = new L10N(EmbeddableType.class); 49 50 public EmbeddableType(AmberPersistenceUnit amberPersistenceUnit) 51 { 52 super(amberPersistenceUnit); 53 } 54 55 58 public Class getInstanceClass() 59 { 60 return getInstanceClass(Embeddable.class); 61 } 62 63 66 public String generateLoadSelect(Table table, String id) 67 { 68 return generateLoadSelect(table, id, -1); 69 } 70 71 74 public Embeddable createObject() 75 throws SQLException 76 { 77 try { 78 return (Embeddable) getInstanceClass().newInstance(); 79 } catch (Exception e) { 80 throw new AmberRuntimeException(e); 81 } 82 } 83 84 87 public String toString() 88 { 89 return "EmbeddableType[" + _beanClass.getName() + "]"; 90 } 91 } 92 | Popular Tags |