FAQ
Hi all,

I have just created a custom ExtendedType to allow Cayenne to
load/save DateTime object created with the Joda Time API. I find the
Joda Time solves many problems that I have with Java's built-in Date
and Calendar classes, so I have just moved our codebase over to use
Joda Time.

The file is attached incase anyone else would like to use it. To hook
it up you need to call this code at the start of your application.

DataDomain domain = Configuration.getSharedConfiguration().getDomain();
ExtendedTypeMap extendedTypes =
domain.getNode("putYourDateNodeNameHere").getAdapter().getExtendedTypes();
extendedTypes.registerType(new DateTimeType());

I do have one question however:

What is the purpose of the ExtendedType.validateProperty() function?
I was forced to implement it, but the docs say that it is deprecated?
My version is never called in my app for some reason, and I just
return true.

Here are the docs:
Deprecated. since 3.0 as validation should not be done at the DataNode level.
Performs validation of an object property. Property is considered
valid if this it satisfies the database constraints known to this
ExtendedType. In case of validation failure, failures are appended to
the ValidationResult object and false is returned.

And here is the issue:
https://issues.apache.org/jira/browse/CAY-657

Do I need to worry about this function?

Marc

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 3 | next ›
Discussion Overview
groupuser @
categoriescayenne
postedAug 8, '11 at 10:55p
activeOct 4, '11 at 5:52p
posts3
users2
websitecayenne.apache.org

2 users in discussion

Marc O'Morain: 2 posts Andrus Adamchik: 1 post

People

Translate

site design / logo © 2022 Grokbase