ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Crocker, Patrick" <patrick.croc...@verizon.com>
Subject Abator and composite keys
Date Thu, 14 Sep 2006 19:32:49 GMT
I am using Abator to generate the java model and sql map for a table
that has a composite key across three columns.  What I *expect* to
happened is for Abator to generate the record class (MY_COLUMN_1,
MY_COLUMN_2) AND the key class (MY_KEY_COLUMN_1, MY_KEY_COLUMN_2).

However, the only class that is created is the record class containing
all the columns (MY_KEY_COLUMN_1, MY_KEY_COLUMN_2, MY_COLUMN_1,
MY_COLUMN_2).

Are my assumptions wrong here, or is Abator not working properly? 

Here is the setup:

Abator: v1.0.0-238
Database: Oracle 9.2.6.0
Table:
CREATE TABLE MY_TABLE
(
  MY_KEY_COLUMN_1   VARCHAR2(25 BYTE)         NOT NULL,
  MY_KEY_COLUMN_2   VARCHAR2(25 BYTE)         NOT NULL,
  MY_COLUMN_1       VARCHAR2(25 BYTE)         NOT NULL,
  MY_COLUMN_2       VARCHAR2(25 BYTE)         NOT NULL,
)

CREATE UNIQUE INDEX MY_TABLE ON MY_TABLE
(MY_KEY_COLUMN_1, MY_KEY_COLUMN_2)
...
NOPARALLEL;

Generated Record Class:

public class MyTable {

    private String myKeyColumn1;

    private String myKeyColumn2;

    private String myColumn1;

    private String myColumn2;

	public String getMyColumn1() {
		return myColumn1;
	}

	public void setMyColumn1(String myColumn1) {
		this.myColumn1 = myColumn1;
	}

	public String getMyColumn2() {
		return myColumn2;
	}

	public void setMyColumn2(String myColumn2) {
		this.myColumn2 = myColumn2;
	}

	public String getMyKeyColumn1() {
		return myKeyColumn1;
	}

	public void setMyKeyColumn1(String myKeyColumn1) {
		this.myKeyColumn1 = myKeyColumn1;
	}

	public String getMyKeyColumn2() {
		return myKeyColumn2;
	}

	public void setMyKeyColumn2(String myKeyColumn2) {
		this.myKeyColumn2 = myKeyColumn2;
	}
}

Thank you,

- Patrick.

Mime
View raw message