/* $Header: Cars.java 15-mar-00.09:07:43 rbhyrava Exp $ */

/* Copyright (c) Oracle Corporation 2000. All Rights Reserved. */

/*
   DESCRIPTION
    <short description of component this file declares/defines>

   PRIVATE CLASSES
    <list of private classes defined - with one-line descriptions>

   NOTES
    <other useful comments, qualifications, etc.>

   MODIFIED    (MM/DD/YY)
    rbhyrava    03/15/00 - AQ jms demo -Jpub generated class for CARS Type
    rbhyrava    03/15/00 - Creation
 */

/**
 *  @version $Header: Cars.java 15-mar-00.09:07:43 rbhyrava Exp $
 *  @author  rbhyrava
 *  @since   release specific (what release of product did this appear in)
 */

/****
 * Jpub generated class for for CARS object type 
 * Used in aqjmsdemo05.java, aqjmsdemo06.java                      
 ***/
import java.sql.SQLException;
import oracle.jdbc.driver.OracleConnection;
import oracle.jdbc.driver.OracleTypes;
import oracle.sql.CustomDatum;
import oracle.sql.CustomDatumFactory;
import oracle.sql.Datum;
import oracle.sql.STRUCT;
import oracle.jpub.runtime.MutableStruct;

public class Cars implements CustomDatum, CustomDatumFactory
{
  public static final String _SQL_NAME = "JMSUSER.CARS";
  public static final int _SQL_TYPECODE = OracleTypes.STRUCT;

  MutableStruct _struct;

  static int[] _sqlType =
  {
    2, 12, 2, 2, 12
  };

  static CustomDatumFactory[] _factory = new CustomDatumFactory[5];

  static final Cars _CarsFactory = new Cars();
  public static CustomDatumFactory getFactory()
  {
    return _CarsFactory;
  }

  /* constructor */
  public Cars()
  {
    _struct = new MutableStruct(new Object[5], _sqlType, _factory);
  }

  /* CustomDatum interface */
  public Datum toDatum(OracleConnection c) throws SQLException
  {
    return _struct.toDatum(c, _SQL_NAME);
  }

  /* CustomDatumFactory interface */
  public CustomDatum create(Datum d, int sqlType) throws SQLException
  {
    if (d == null) return null;
    Cars o = new Cars();
    o._struct = new MutableStruct((STRUCT) d, _sqlType, _factory);
    return o;
  }

  /* accessor methods */
  public java.math.BigDecimal getCarno() throws SQLException
  { return (java.math.BigDecimal) _struct.getAttribute(0); }

  public void setCarno(java.math.BigDecimal carno) throws SQLException
  { _struct.setAttribute(0, carno); }


  public String getMake() throws SQLException
  { return (String) _struct.getAttribute(1); }

  public void setMake(String make) throws SQLException
  { _struct.setAttribute(1, make); }


  public java.math.BigDecimal getYear() throws SQLException
  { return (java.math.BigDecimal) _struct.getAttribute(2); }

  public void setYear(java.math.BigDecimal year) throws SQLException
  { _struct.setAttribute(2, year); }


  public java.math.BigDecimal getPrice() throws SQLException
  { return (java.math.BigDecimal) _struct.getAttribute(3); }

  public void setPrice(java.math.BigDecimal price) throws SQLException
  { _struct.setAttribute(3, price); }


  public String getColor() throws SQLException
  { return (String) _struct.getAttribute(4); }

  public void setColor(String color) throws SQLException
  { _struct.setAttribute(4, color); }

}
