|
Hi Folks,
i have two classes: Note and NoteType:
<class name="dbo_test.Domain.NoteType"
identity="code" access="read-only">
<map-to table="NoteType" xml="NoteType" /> <field name="code" type="string"> <sql name="NoteTypeCode" type="char" /> <xml name="NoteTypeCode" node="attribute"/> </field> <field name="name" type="string" required="true"> <sql name="NoteTypeName" type="varchar" /> <xml name="NoteTypeName" node="element" /> </field> <field name="desc" type="string"> <sql name="NoteTypeDesc" type="varchar" /> <xml name="NoteTypeDesc" node="element" /> </field> <field name="image" type="bytes"> <sql name="NoteTypeImage" type="varbinary" dirty="ignore" /> </field> </class> <class name="dbo_test.Domain.Note"
identity="id" key-generator="IDENTITY">
<map-to table="Note" xml="Note" /> <field name="id" type="integer"> <sql name="NoteID" type="integer" /> <xml name="NoteID" node="attribute"/> </field> <field name="text" type="string" required="true"> <sql name="NoteText" type="varchar" /> <xml name="NoteText" node="element" /> </field> <field name="stamp" type="date" required="true"> <sql name="NoteStamp" type="date"/> <xml name="NoteStamp" node="element" /> </field> <field name="type" type="dbo_test.Domain.NoteType" required="true"> <sql name="NoteTypeCode"/> <xml name="NoteType" node="element" /> </field> </class> i do store instances of NoteType class in database,
but i want to load them once and use them in static manner:
public class NoteType {
private String
_code;
private String _name; private String _desc; private byte[] _image; public static NoteType creationNote = new NoteType("C");
public static NoteType deletionNote = new
NoteType("D"); .....}
is it possible to do with Castor?
Regards, Denis.
|
- Re: [castor-dev] Static instances for Data Objects Denis Sukhoroslov
- Re: [castor-dev] Static instances for Data Objects Bruce Snyder
