[prev in list] [next in list] [prev in thread] [next in thread]
List: castor-user
Subject: RE: [castor-user] log4j
From: "Werner Guttmann" <W.Guttmann () betandwin ! com>
Date: 2005-11-16 8:21:11
Message-ID: A80E2AEA0D5D02409F90DF5871A15A1443033B () EX1 ! baw ! local
[Download RAW message or body]
Shiva,
Castor already includes a preset log4j config file that sets the default
debug level to "warn" (as far as I remember). You could change this by
A) making the relevant change in the log4j.xml file as shipped with the
Castor JAR file you are using.
B) Include a new log4j configuration file somewhere on your CLASSPATH
and point the JVM to this file using the -Dlog4j.configuration system
property.
Regards
Werner
> -----Original Message-----
> From: Shiva P. Kodityala [mailto:SPKodityala@scif.com]
> Sent: Mittwoch, 16. November 2005 00:36
> To: user@castor.codehaus.org
> Subject: [castor-user] log4j
>
> Could somebody let me know how to do trace using log4j?
>
> -----Original Message-----
> From: Sandeep Khanna [mailto:sandeep.khanna@villanova.edu]
> Sent: Tuesday, November 15, 2005 2:48 PM
> To: user@castor.codehaus.org
> Subject: [castor-user] Populating containing object
> attributes using parent object'sattributes...
>
>
> Hi All,
>
> Please pardon the long email. Most of it is just sample data.
>
> Given the following visual representation of Object
> relationships & the relevant Castor mapping:
>
> ClientDcl
> |-ClientGUID
> |-FirstName
> |-LastName
> |-...
> |-AddressRoleDcl
> |-AddressRoleGUID
> |-ClientGUID
> |-AddressGUID
> |-...
> |-AddressDcl
> |-AddressGUID
> |-...
>
> We have a GUIDGeneratorUtl class that creates unique GUIDs.
> We would like to use it from within the Castor framework to
> create and populate the appropriate GUID attributes in the
> above Object relationships.
>
> Questions:
> 1) How do I setup/use a GUID generator class from within the
> Castor mapping file.
> 2) As per the above visual Object relationship, we would
> require the ClientGUID that was generated and set on the
> ClientDcl object to be used while setting the ClientGUID
> attribute on the AddressRoleDcl object contained in the
> ClientDcl instance.
> 3) As per the above visual Object relationship,
> AddressRoleDcl.AddressGUID needs to be set from the
> AddressDcl.AddressGUID which would be generated only after we
> unmarshall or parse the AddressDcl element/node. One way
> would be to unmarshall the AddressDcl element/node first to
> have the AddressGUID ready before unmarshalling
> AddressRoleDcl element/node.
>
> A sample Castor mapping file & the XML data that needs to be
> unmarshalled follows:
>
> ######################################################################
> ########################## Castor Mapping file
> #######################
> ######################################################################
> <?xml version="1.0"?>
>
> <!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Mapping DTD
> Version 1.0//EN"
> "http://castor.exolab.org/mapping.dtd">
>
> <!-- This mapping file is generated by XDoclet. Please do not
> edit! --> <mapping>
> <!--
> ==============================================================
> ===== -->
> <!-- Mapping for class com.adminserver.dcl.ClientDcl -->
> <!--
> ==============================================================
> ===== -->
> <class name="com.adminserver.dcl.ClientDcl"
> identity="_clientGuid"
> access="shared"
> auto-complete="false">
> <map-to table="AsClient" xml="AsClient"/>
> <cache-type type="count-limited"/>
> <field name="clientGuid" type="string"
> get-method="getClientGuid"
> set-method="setClientGuid">
> <bind-xml name="ClientGUID" node="element"/>
> </field>
> <field name="sex" type="string" get-method="getSex"
> set-method="setSex">
> <bind-xml name="Sex" node="element"/>
> </field>
> <field name="dateOfBirth" type="java.util.Date"
> get-method="getDateOfBirth"
> set-method="setDateOfBirth">
> <bind-xml name="DateOfBirth" node="element"/>
> </field>
> <field name="email" type="string" get-method="getEmail"
> set-method="setEmail">
> <bind-xml name="Email" node="element"/>
> </field>
> <field name="dateOfDeath" type="java.util.Date"
> get-method="getDateOfDeath"
> set-method="setDateOfDeath">
> <bind-xml name="DateOfDeath" node="element"/>
> </field>
> <field name="typeCode" type="string"
> get-method="getTypeCode"
> set-method="setTypeCode">
> <bind-xml name="TypeCode" node="element"/>
> </field>
> <field name="taxId" type="string" get-method="getTaxId"
> set-method="setTaxId">
> <bind-xml name="TaxID" node="element"/>
> </field>
> <field name="firstName" type="string"
> get-method="getFirstName" set-method="setFirstName">
> <bind-xml name="FirstName" node="element"/>
> </field>
> <field name="middleInitial" type="string"
> get-method="getMiddleInitial"
> set-method="setMiddleInitial">
> <bind-xml name="MiddleInitial" node="element"/>
> </field>
> <field name="companyName" type="string"
> get-method="getCompanyName"
> set-method="setCompanyName">
> <bind-xml name="CompanyName" node="element"/>
> </field>
> <field name="lastName" type="string"
> get-method="getLastName"
> set-method="setLastName">
> <bind-xml name="LastName" node="element"/>
> </field>
> <field name="fields"
> type="com.adminserver.dcl.ClientFieldDcl"
> get-method="getFields"
> set-method="setFields" collection="map">
> <bind-xml name="Field" node="element"
> location="Fields"/>
> </field>
> <field name="addressRoles"
> type="com.adminserver.dcl.AddressRoleDcl"
> get-method="getAddressRoles"
> set-method="setAddressRoles"
> collection="map">
> <bind-xml name="AddressRole" node="element"
> location="AddressRoles">
> </bind-xml>
> </field>
> <field name="roles" type="com.adminserver.dcl.RoleDcl"
> get-method="getRoles"
> set-method="setRoles" collection="set"
> transient="false">
> <bind-xml name="Role" node="element" location="Roles"/>
> </field>
> </class>
> <!--
> ==============================================================
> ===== -->
> <!-- Mapping for class com.adminserver.dcl.ClientFieldDcl -->
> <!--
> ==============================================================
> ===== -->
> <class name="com.adminserver.dcl.ClientFieldDcl"
> identity="_clientGuid, _fieldName"
> access="shared" auto-complete="false">
> <map-to table="AsClientField" xml="AsClientField"/>
> <cache-type type="count-limited"/>
> <field name="clientGuid" type="string"
> get-method="getClientGuid"
> set-method="setClientGuid">
> <bind-xml name="ClientGUID" node="element"/>
> </field>
> <field name="fieldName" type="string"
> get-method="getFieldName" set-method="setFieldName">
> <bind-xml name="FieldName" node="element"/>
> </field>
> <field name="textValue" type="string"
> get-method="getTextValue" set-method="setTextValue">
> <bind-xml name="TextValue" node="element"/>
> </field>
> <field name="fieldTypeCode" type="string"
> get-method="getFieldTypeCode"
> set-method="setFieldTypeCode">
> <bind-xml name="FieldTypeCode" node="element"/>
> </field>
> </class>
> <!--
> ==============================================================
> ===== -->
> <!-- Mapping for class com.adminserver.dcl.AddressRoleDcl -->
> <!--
> ==============================================================
> ===== -->
> <class name="com.adminserver.dcl.AddressRoleDcl"
> identity="_addressRoleGuid" access="shared"
> auto-complete="false">
> <map-to table="AsAddressRole" xml="AsAddressRole"/>
> <cache-type type="count-limited"/>
> <field name="addressRoleGuid" type="string"
>
> get-method="getAddressRoleGuid"
> set-method="setAddressRoleGuid">
> <bind-xml name="AddressRoleGUID" node="element"/>
> </field>
> <field name="emailCorrespondenceFlag" type="string"
> get-method="getEmailCorrespondenceFlag"
> set-method="setEmailCorrespondenceFlag">
> <bind-xml name="EmailACorrespondenceFlag"
> node="element"/>
> </field>
> <field name="addressGuid" type="string"
> get-method="getAddressGuid"
> set-method="setAddressGuid">
> <bind-xml name="AddressGUID" node="element"/>
> </field>
> <field name="clientGuid" type="string"
> get-method="getClientGuid"
> set-method="setClientGuid">
> <bind-xml name="ClientGUID" node="element"/>
> </field>
> <field name="addressRoleCode" type="string"
> get-method="getAddressRoleCode"
> set-method="setAddressRoleCode">
> <bind-xml name="AddressRoleCode" node="element"/>
> </field>
> <field name="defaultFlag" type="string"
> get-method="getDefaultFlag"
> set-method="setDefaultFlag">
> <bind-xml name="DefaultFlag" node="element"/>
> </field>
> <field name="address" type="com.adminserver.dcl.AddressDcl"
> get-method="getAddress"
> set-method="setAddress">
> <bind-xml name="Address" node="element"/>
> </field>
> <field name="client" type="com.adminserver.dcl.ClientDcl"
> get-method="getClient"
> set-method="setClient">
> <bind-xml name="Client" node="element"/>
> </field>
> </class>
> <!--
> ==============================================================
> ===== -->
> <!-- Mapping for class com.adminserver.dcl.AddressDcl -->
> <!--
> ==============================================================
> ===== -->
> <class name="com.adminserver.dcl.AddressDcl"
> identity="_addressGuid" access="shared"
> auto-complete="false">
> <map-to table="AsAddress" xml="AsAddress"/>
> <cache-type type="count-limited"/>
> <field name="addressGuid" type="string"
> get-method="getAddressGuid"
> set-method="setAddressGuid">
> <bind-xml name="AddressGUID" node="element"/>
> </field>
> <field name="addressLine3" type="string"
> get-method="getAddressLine3"
> set-method="setAddressLine3">
> <bind-xml name="AddressLine3" node="element"/>
> </field>
> <field name="addressLine2" type="string"
> get-method="getAddressLine2"
> set-method="setAddressLine2">
> <bind-xml name="AddressLine2" node="element"/>
> </field>
> <field name="city" type="string" get-method="getCity"
> set-method="setCity">
> <bind-xml name="City" node="element"/>
> </field>
> <field name="effectiveDate" type="java.util.Date"
> get-method="getEffectiveDate"
> set-method="setEffectiveDate">
> <bind-xml name="EffectiveDate" node="element"/>
> </field>
> <field name="expirationDate" type="java.util.Date"
> get-method="getExpirationDate"
> set-method="setExpirationDate">
> <bind-xml name="ExpirationDate" node="element"/>
> </field>
> <field name="email" type="string" get-method="getEmail"
> set-method="setEmail">
> <bind-xml name="Email" node="element"/>
> </field>
> <field name="stateCode" type="string"
> get-method="getStateCode" set-method="setStateCode">
> <bind-xml name="StateCode" node="element"/>
> </field>
> <field name="faxNumber" type="string"
> get-method="getFaxNumber" set-method="setFaxNumber">
> <bind-xml name="FaxNumber" node="element"/>
> </field>
> <field name="phoneNumber" type="string"
> get-method="getPhoneNumber"
> set-method="setPhoneNumber">
> <bind-xml name="PhoneNumber" node="element"/>
> </field>
> <field name="addressLine1" type="string"
> get-method="getAddressLine1"
> set-method="setAddressLine1">
> <bind-xml name="AddressLine1" node="element"/>
> </field>
> <field name="postalId" type="string"
> get-method="getPostalId"
> set-method="setPostalId">
> <bind-xml name="PostalID" node="element"/>
> </field>
> <field name="addressLine4" type="string"
> get-method="getAddressLine4"
> set-method="setAddressLine4">
> <bind-xml name="AddressLine4" node="element"/>
> </field>
> <field name="countryCode" type="string"
> get-method="getCountryCode"
> set-method="setCountryCode">
> <bind-xml name="CountryCode" node="element"/>
> </field>
> <field name="addressRole"
> type="com.adminserver.dcl.AddressRoleDcl"
> get-method="getAddressRole"
> set-method="setAddressRole">
> <bind-xml name="AddressRole" node="element"/>
> </field>
> <field name="fields"
> type="com.adminserver.dcl.AddressFieldDcl" get-method="getFields"
> set-method="setFields" collection="map"
> transient="true">
> <bind-xml name="Field" node="element"
> location="Fields"/>
> </field>
> </class>
> <!--
> ==============================================================
> ===== -->
> <!-- Mapping for class com.adminserver.dcl.AddressFieldDcl -->
> <!--
> ==============================================================
> ===== -->
> <class name="com.adminserver.dcl.AddressFieldDcl"
> identity="_addressGuid, _fieldName"
> access="shared" auto-complete="false">
> <map-to table="AsAddressFiled" xml="AsAddressField"/>
> <cache-type type="count-limited"/>
> <field name="addressGuid" type="string"
> get-method="getAddressGuid"
> set-method="setAddressGuid">
> <bind-xml name="AddressGUID" node="element"/>
> </field>
> <field name="fieldName" type="string"
> get-method="getFieldName" set-method="setFieldName">
> <bind-xml name="FieldName" node="element"/>
> </field>
> <field name="textValue" type="string"
> get-method="getTextValue" set-method="setTextValue">
> <bind-xml name="TextValue" node="element"/>
> </field>
> <field name="fieldTypeCode" type="string"
> get-method="getFieldTypeCode"
> set-method="setFieldTypeCode">
> <bind-xml name="FieldTypeCode" node="element"/>
> </field>
> </class>
> <!--
> Define your key-generator declaration in a file
> called key-generator.xml and place it in your merge directory.
> -->
> </mapping>
>
>
> ######################################################################
> ############################## XML data
> ##############################
> ######################################################################
> <?xml version="1.0" encoding="UTF-8"?>
> <Results>
> <Clients>
> <AsClient>
> <ClientGUID/>
> <TypeCode>03</TypeCode>
> <CompanyName/>
> <LastName>CAMBELL</LastName>
> <FirstName>MICHAEL</FirstName>
> <MiddleInitial>JAMES</MiddleInitial>
> <Sex/>
> <DateOfBirth>11-12-1950</DateOfBirth>
> <DateofDeath/>
> <TaxID/>
> <Email>EMAILADDRESS@EMAIL.COM</Email>
> <XMLData/>
> <UpdatedGMT/>
> <Fields>
> <AsClientField>
> <ClientGUID/>
> <FieldName>ProducerID</FieldName>
> <FieldTypeCode>02</FieldTypeCode>
> <TextValue>PROD001</TextValue>
> </AsClientField>
> <AsClientField>
> <ClientGUID/>
> <FieldName>ProducerCode</FieldName>
> <FieldTypeCode>02</FieldTypeCode>
> <TextValue>Producer Code</TextValue>
> </AsClientField>
> <AsClientField>
> <ClientGUID/>
> <FieldName>Profile</FieldName>
> <FieldTypeCode>02</FieldTypeCode>
> <TextValue>Profile</TextValue>
> </AsClientField>
> <AsClientField>
> <ClientGUID/>
> <FieldName>BrokerDealerName</FieldName>
> <FieldTypeCode>02</FieldTypeCode>
> <TextValue/>
> </AsClientField>
> <AsClientField>
> <ClientGUID/>
> <FieldName>BrokerDealerNumber</FieldName>
> <FieldTypeCode>02</FieldTypeCode>
> <TextValue>PROD001</TextValue>
> </AsClientField>
> <AsClientField>
> <ClientGUID/>
> <FieldName>Suffix</FieldName>
> <FieldTypeCode>02</FieldTypeCode>
> <TextValue>Jr</TextValue>
> </AsClientField>
> <AsClientField>
> <ClientGUID/>
> <FieldName>Status</FieldName>
> <FieldTypeCode>02</FieldTypeCode>
> <TextValue>1</TextValue>
> </AsClientField>
> <AsClientField>
> <ClientGUID/>
> <FieldName>ContractType</FieldName>
> <FieldTypeCode>02</FieldTypeCode>
> <TextValue>Contract Type</TextValue>
> </AsClientField>
> </Fields>
> <AddressRoles>
> <AsAddressRole>
> <AddressRoleGUID/>
> <AddressRoleCode>2</AddressRoleCode>
> <ClientGUID/>
> <AddressGUID/>
> <DefaultFlag/>
> <EmailCorrespondenceFlag/>
> <AsAddress>
> <AddressGUID/>
> <AddressLine1>81 ALEXANDRA
> DRIVE</AddressLine1>
> <AddressLine2/>
> <AddressLine3/>
> <addressLine4/>
> <City>NEW BRITIAN</City>
> <StateCode>07</StateCode>
> <CountryCode/>
> <PostalID>06789</PostalID>
> <Email>EMAILADDRESS@EMAIL.COM</Email>
> <PhoneNumber>860- 221-5555- 1521</PhoneNumber>
> <FaxNumber>860- 555-1212</FaxNumber>
> <XMLData/>
> <EffectiveDate/>
> <ExpirationDate/>
> <Fields>
> <AsAddressField>
> <ClientGUID/>
> <FieldName/>
> <FieldTypeCode>02</FieldTypeCode>
> <TextValue/>
> </AsAddressField>
> </Fields>
> </AsAddress>
> </AsAddressRole>
> </AddressRoles>
> </AsClient>
> <AsClient>
> <ClientGUID/>
> <TypeCode>08</TypeCode>
> <CompanyName>Broker Dealer Name</CompanyName>
> <LastName/>
> <FirstName/>
> <MiddleInitial/>
> <Sex/>
> <DateOfBirth/>
> <DateofDeath/>
> <TaxID/>
> <Email/>
> <XMLData/>
> <UpdatedGMT/>
> <Fields>
> <AsClientField>
> <ClientGUID/>
> <FieldName>ProducerID</FieldName>
> <FieldTypeCode>02</FieldTypeCode>
> <TextValue>Broker/Dealer Number</TextValue>
> </AsClientField>
> <AsClientField>
> <ClientGUID/>
> <FieldName>ProducerCode</FieldName>
> <FieldTypeCode>02</FieldTypeCode>
> <TextValue/>
> </AsClientField>
> <AsClientField>
> <ClientGUID/>
> <FieldName>Profile</FieldName>
> <FieldTypeCode>02</FieldTypeCode>
> <TextValue/>
> </AsClientField>
> <AsClientField>
> <ClientGUID/>
> <FieldName>BrokerDealerName</FieldName>
> <FieldTypeCode>02</FieldTypeCode>
> <TextValue>Broker Dealer Name</TextValue>
> </AsClientField>
> <AsClientField>
> <ClientGUID/>
> <FieldName>BrokerDealerNumber</FieldName>
> <FieldTypeCode>02</FieldTypeCode>
> <TextValue>Broker/Dealer Number</TextValue>
> </AsClientField>
> <AsClientField>
> <ClientGUID/>
> <FieldName>Suffix</FieldName>
> <FieldTypeCode>02</FieldTypeCode>
> <TextValue/>
> </AsClientField>
> <AsClientField>
> <ClientGUID/>
> <FieldName>Status</FieldName>
> <FieldTypeCode>02</FieldTypeCode>
> <TextValue/>
> </AsClientField>
> <AsClientField>
> <ClientGUID/>
> <FieldName>ContractType</FieldName>
> <FieldTypeCode>02</FieldTypeCode>
> <TextValue/>
> </AsClientField>
> </Fields>
> <AddressRoles>
> <AsAddressRole>
> <AddressRoleGUID/>
> <AddressRoleCode/>
> <ClientGUID/>
> <AddressGUID/>
> <DefaultFlag/>
> <EmailCorrespondenceFlag/>
> <AsAddress>
> <AddressGUID/>
> <AddressLine1/>
> <AddressLine2/>
> <AddressLine3/>
> <addressLine4/>
> <City/>
> <StateCode/>
> <CountryCode/>
> <PostalID/>
> <Email/>
> <PhoneNumber/>
> <FaxNumber/>
> <XMLData/>
> <EffectiveDate/>
> <ExpirationDate/>
> <Fields>
> <AsAddressField>
> <ClientGUID/>
> <FieldName/>
> <FieldTypeCode>02</FieldTypeCode>
> <TextValue/>
> </AsAddressField>
> </Fields>
> </AsAddress>
> </AsAddressRole>
> </AddressRoles>
> </AsClient>
> </Clients>
> </Results>
>
>
> Any help/suggestions would be appreciated.
>
> Thanks,
> Sandeep Khanna
>
>
> -------------------------------------------------
> If you wish to unsubscribe from this list, please send an
> empty message to the following address:
>
> user-unsubscribe@castor.codehaus.org
> -------------------------------------------------
>
>
> -------------------------------------------------
> If you wish to unsubscribe from this list, please send an
> empty message to the following address:
>
> user-unsubscribe@castor.codehaus.org
> -------------------------------------------------
>
>
>
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
user-unsubscribe@castor.codehaus.org
-------------------------------------------------
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic