Newbie: how to use validate<attributeName> with D2W Application
Newbie: how to use validate<attributeName> with D2W Application
- Subject: Newbie: how to use validate<attributeName> with D2W Application
- From: David Chaney <email@hidden>
- Date: Tue, 24 Aug 2004 16:34:56 -0400
I'm trying to use validate<attributeName> method with a D2W Application
and have been unsuccessful so far. I am trying to update a
"lastModified" NSTimestamp attribute in a product entity of my EO
Model. My goal is to have the attribute updated to the current time
every time a product object is modified. After doing some searching
through the archives I created the following Product .java class file
in the project:
// Product.java
// Created on Tue Aug 10 13:05:46 US/Eastern 2004 by Apple EOModeler
Version 5.2
import com.webobjects.foundation.*;
import com.webobjects.eocontrol.*;
import java.math.BigDecimal;
import java.util.*;
public class Product extends EOGenericRecord {
public Product() {
super();
}
public void awakeFromInsertion(EOEditingContext editingContext) {
super.awakeFromInsertion(editingContext);
setProductType(entityName());
}
public String productType() {
return (String)storedValueForKey("productType");
}
public void setProductType(String value) {
takeStoredValueForKey(value, "productType");
}
public NSTimestamp lastModified() {
return (NSTimestamp)storedValueForKey("lastModified");
}
public void setLastModified(NSTimestamp value) {
takeStoredValueForKey(value, "lastModified");
}
public NSTimestamp validateLastModfied(NSTimestamp value) {
return new NSTimestamp();
}
}
However... it is still not working correctly any help greatly
appreciated
- David
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.