01: /*
02: * Copyright (c) 2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: *
16: */
17:
18: package org.jpublish.module.cayenne.demo;
19:
20: import org.apache.cayenne.PersistenceState;
21: import org.jpublish.module.cayenne.demo.auto._Todo;
22:
23: public class Todo extends _Todo {
24:
25: public void setPersistenceState(int state) {
26: super .setPersistenceState(state);
27:
28: // if the object was just created, set initial values
29: if (state == PersistenceState.NEW) {
30: // Set all initial values here
31: this.setIsDone(Boolean.FALSE);
32: }
33: }
34:
35: }
|