Re: Newbie: how to use validate<attributeName> with D2W Application
Re: Newbie: how to use validate<attributeName> with D2W Application
- Subject: Re: Newbie: how to use validate<attributeName> with D2W Application
- From: David Chaney <email@hidden>
- Date: Tue, 24 Aug 2004 16:57:40 -0400
NEVERMIND...
Looks like I spelled it wrong... should be "validateLastModified" not
"validateLastModfied". I must have looked at that code 30 minutes
before posting, but caught it in 30 seconds in rereading the post. It
seems to be working as expected now. Looks like this method might be
useful for a lotta things... nice.
- David
On Aug 24, 2004, at 4:34 PM, David Chaney wrote:
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.
_______________________________________________
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.