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 public static double WRAPPING_COST = 2.5d;
13
14 public WrappingTable(
15 Database database, String name,
16 DefinitionSource definitionSource) throws PoemException {
17 super(database, name, definitionSource);
18 }
19
20 private Wrapping noWrapping;
21
22 public synchronized void unifyWithDB(ResultSet colDescs)
23 throws PoemException {
24 super.unifyWithDB(colDescs);
25 noWrapping = ensure("No Wrapping");
26 }
27
28 public Wrapping ensure(String name) {
29 Wrapping wrapping = (Wrapping)newPersistent();
30 wrapping.setWrapping(name);
31 wrapping.setDisplayPositon(0);
32 return (Wrapping)getWrappingColumn().ensure(wrapping);
33 }
34
35 public Wrapping getNoWrapping() {
36 return noWrapping;
37 }
38 }