1 | |
package org.paneris.jammyjoes.model; |
2 | |
|
3 | |
import java.sql.ResultSet; |
4 | |
|
5 | |
import org.melati.poem.Database; |
6 | |
import org.melati.poem.DefinitionSource; |
7 | |
import org.melati.poem.PoemException; |
8 | |
import org.paneris.jammyjoes.model.generated.WrappingTableBase; |
9 | |
|
10 | |
public class WrappingTable extends WrappingTableBase { |
11 | |
|
12 | 0 | public static double WRAPPING_COST = 2.5d; |
13 | |
|
14 | |
public WrappingTable( |
15 | |
Database database, String name, |
16 | |
DefinitionSource definitionSource) throws PoemException { |
17 | 0 | super(database, name, definitionSource); |
18 | 0 | } |
19 | |
|
20 | |
private Wrapping noWrapping; |
21 | |
|
22 | |
public synchronized void unifyWithDB(ResultSet colDescs) |
23 | |
throws PoemException { |
24 | 0 | super.unifyWithDB(colDescs); |
25 | 0 | noWrapping = ensure("No Wrapping"); |
26 | 0 | } |
27 | |
|
28 | |
public Wrapping ensure(String name) { |
29 | 0 | Wrapping wrapping = (Wrapping)newPersistent(); |
30 | 0 | wrapping.setWrapping(name); |
31 | 0 | wrapping.setDisplayPositon(0); |
32 | 0 | return (Wrapping)getWrappingColumn().ensure(wrapping); |
33 | |
} |
34 | |
|
35 | |
public Wrapping getNoWrapping() { |
36 | 0 | return noWrapping; |
37 | |
} |
38 | |
} |