KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > triactive > jdo > store > CandidateKeyIdentifier


1 /*
2  * Copyright 2002 (C) TJDO.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the TJDO License version 1.0.
6  * See the terms of the TJDO License in the documentation provided with this software.
7  *
8  * $Id: CandidateKeyIdentifier.java,v 1.4 2003/02/26 00:22:36 jackknifebarber Exp $
9  */

10
11 package com.triactive.jdo.store;
12
13
14 class CandidateKeyIdentifier extends SQLIdentifier
15 {
16     public CandidateKeyIdentifier(BaseTable table, int seq)
17     {
18         super(table.getStoreManager().getDatabaseAdapter());
19
20         this.javaName = null;
21
22         String JavaDoc baseID = truncate(table.getName().getSQLIdentifier(), getMaxLength() - 4);
23
24         setSQLIdentifier(baseID + "_U" + seq);
25     }
26
27
28     protected int getMaxLength()
29     {
30         return dba.getMaxConstraintNameLength();
31     }
32 }
33
Popular Tags