01: /*
02: * Copyright 2002 (C) TJDO.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the TJDO License version 1.0.
06: * See the terms of the TJDO License in the documentation provided with this software.
07: *
08: * $Id: PrimaryKeyIdentifier.java,v 1.4 2003/02/26 00:22:54 jackknifebarber Exp $
09: */
10:
11: package com.triactive.jdo.store;
12:
13: class PrimaryKeyIdentifier extends SQLIdentifier {
14: public PrimaryKeyIdentifier(BaseTable table) {
15: super (table.getStoreManager().getDatabaseAdapter());
16:
17: this .javaName = null;
18:
19: String baseID = truncate(table.getName().getSQLIdentifier(),
20: getMaxLength() - 4);
21:
22: setSQLIdentifier(baseID + "_PK");
23: }
24:
25: protected int getMaxLength() {
26: return dba.getMaxConstraintNameLength();
27: }
28: }
|