-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathPERSON.java
99 lines (79 loc) · 2.72 KB
/
PERSON.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/* $Header: PERSON.java 15-mar-00.09:06:53 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 API demo -Jpub generated class for PERSON Type
rbhyrava 03/15/00 - Creation
*/
/**
* @version $Header: PERSON.java 15-mar-00.09:06:53 rbhyrava Exp $
* @author rbhyrava
* @since release specific (what release of product did this appear in)
*/
/****
* Jpub generated class for for ADDRESS object type
* Used in aqorademo02.java
***/
import java.sql.SQLException;
import java.sql.Connection;
import oracle.jdbc.OracleTypes;
import oracle.sql.ORAData;
import oracle.sql.ORADataFactory;
import oracle.sql.Datum;
import oracle.sql.STRUCT;
import oracle.jpub.runtime.MutableStruct;
public class PERSON implements ORAData, ORADataFactory
{
public static final String _SQL_NAME = "AQJAVA.PERSON";
public static final int _SQL_TYPECODE = OracleTypes.STRUCT;
protected MutableStruct _struct;
private static int[] _sqlType = { 12,2002 };
private static ORADataFactory[] _factory = new ORADataFactory[2];
static
{
_factory[1] = ADDRESS.getORADataFactory();
}
protected static final PERSON _PERSONFactory = new PERSON(false);
public static ORADataFactory getORADataFactory()
{ return _PERSONFactory; }
/* constructor */
protected PERSON(boolean init)
{ if(init) _struct = new MutableStruct(new Object[2], _sqlType, _factory); }
public PERSON()
{ this(true); }
public PERSON(String name, ADDRESS home) throws SQLException
{ this(true);
setName(name);
setHome(home);
}
/* ORAData interface */
public Datum toDatum(Connection c) throws SQLException
{
return _struct.toDatum(c, _SQL_NAME);
}
/* ORADataFactory interface */
public ORAData create(Datum d, int sqlType) throws SQLException
{ return create(null, d, sqlType); }
protected ORAData create(PERSON o, Datum d, int sqlType) throws SQLException
{
if (d == null) return null;
if (o == null) o = new PERSON(false);
o._struct = new MutableStruct((STRUCT) d, _sqlType, _factory);
return o;
}
/* accessor methods */
public String getName() throws SQLException
{ return (String) _struct.getAttribute(0); }
public void setName(String name) throws SQLException
{ _struct.setAttribute(0, name); }
public ADDRESS getHome() throws SQLException
{ return (ADDRESS) _struct.getAttribute(1); }
public void setHome(ADDRESS home) throws SQLException
{ _struct.setAttribute(1, home); }
}