PageRenderTime 59ms CodeModel.GetById 36ms RepoModel.GetById 0ms app.codeStats 0ms

/jboss-as-7.1.1.Final/cmp/src/main/java/org/jboss/as/cmp/jdbc/bridge/JDBCFieldBridge.java

#
Java | 123 lines | 26 code | 19 blank | 78 comment | 0 complexity | 865a29cfe09da5f6a259b821a57ab063 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0
  1. /*
  2. * JBoss, Home of Professional Open Source.
  3. * Copyright 2008, Red Hat Middleware LLC, and individual contributors
  4. * as indicated by the @author tags. See the copyright.txt file in the
  5. * distribution for a full listing of individual contributors.
  6. *
  7. * This is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU Lesser General Public License as
  9. * published by the Free Software Foundation; either version 2.1 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This software is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this software; if not, write to the Free
  19. * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  20. * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  21. */
  22. package org.jboss.as.cmp.jdbc.bridge;
  23. import java.sql.PreparedStatement;
  24. import java.sql.ResultSet;
  25. import org.jboss.as.cmp.bridge.FieldBridge;
  26. import org.jboss.as.cmp.context.CmpEntityBeanContext;
  27. import org.jboss.as.cmp.jdbc.JDBCEntityPersistenceStore;
  28. import org.jboss.as.cmp.jdbc.JDBCType;
  29. /**
  30. * @author <a href="mailto:loubyansky@ua.fm">Alex Loubyansky and others</a>
  31. */
  32. public interface JDBCFieldBridge extends FieldBridge {
  33. /**
  34. * Gets the JDBC type of this field.
  35. */
  36. JDBCType getJDBCType();
  37. /**
  38. * Is this field a member of the primary key.
  39. *
  40. * @return true if this field is a member of the primary key
  41. */
  42. boolean isPrimaryKeyMember();
  43. /**
  44. * Is this field read only.
  45. *
  46. * @return true if this field is read only
  47. */
  48. boolean isReadOnly();
  49. /**
  50. * Has current data read timed out?
  51. */
  52. boolean isReadTimedOut(CmpEntityBeanContext ctx);
  53. /**
  54. * Has the data been loaded?
  55. */
  56. boolean isLoaded(CmpEntityBeanContext ctx);
  57. /**
  58. * Set CMPFieldValue to Java default value (i.e., 0 or null).
  59. */
  60. void initInstance(CmpEntityBeanContext ctx);
  61. /**
  62. * Resets any persistence data maintained in the context.
  63. */
  64. void resetPersistenceContext(CmpEntityBeanContext ctx);
  65. /**
  66. * Sets the prepared statement parameters with the data from the
  67. * instance associated with the context.
  68. */
  69. int setInstanceParameters(PreparedStatement ps, int parameterIndex, CmpEntityBeanContext ctx);
  70. /**
  71. * Gets the internal value of this field without user level checks.
  72. *
  73. * @param ctx the context for which this field's value should be fetched
  74. * @return the value of this field
  75. */
  76. Object getInstanceValue(CmpEntityBeanContext ctx);
  77. /**
  78. * Sets the internal value of this field without user level checks.
  79. *
  80. * @param ctx the context for which this field's value should be set
  81. * @param value the new value of this field
  82. */
  83. void setInstanceValue(CmpEntityBeanContext ctx, Object value);
  84. /**
  85. * Loads the data from result set into the instance associated with
  86. * the specified context.
  87. */
  88. int loadInstanceResults(ResultSet rs, int parameterIndex, CmpEntityBeanContext ctx);
  89. /**
  90. * Loads the value of this cmp field from result set into argument reference.
  91. */
  92. int loadArgumentResults(ResultSet rs, int parameterIndex, Object[] argumentRef);
  93. /**
  94. * Has the value of this field changes since the last time clean was called.
  95. */
  96. boolean isDirty(CmpEntityBeanContext ctx);
  97. /**
  98. * Mark this field as clean.
  99. */
  100. void setClean(CmpEntityBeanContext ctx);
  101. boolean isCMPField();
  102. JDBCEntityPersistenceStore getManager();
  103. Object getPrimaryKeyValue(Object arg);
  104. }