AduitInfo class is just a normal java bean.  For example,

package xyz;

import java.sql.Time;
import abc.vo.PersonVO;

public class AuditInformation
{
  private PersonVO createdBy;
  private Time creation;
  private PersonVO editedBy;
  private Time lastEdited;

  public AuditInformation()
  {
  }

  public AuditInformation(PersonVO createdBy,
                          Time creation,
                          PersonVO editedBy,
                          Time lastEdited)
  {
    this.createdBy = createdBy;
    this.creation = creation;
    this.editedBy = editedBy;
    this.lastEdited = lastEdited;
  }

  public PersonVO getCreatedBy()
  {
    return this.createdBy;
  }

  public void setCreatedBy(PersonVO createdBy)
  {
    this.createdBy = createdBy;
  }

  public Time getCreation()
  {
    return this.creation;
  }

  public void setCreation(Time creation)
  {
    this.creation = creation;
  }

  public PersonVO getEditedBy()
  {
    return this.editedBy;
  }

  public void setEditedBy(PersonVO editedBy)
  {
    this.editedBy = editedBy;
  }

  public Time getLastEdited()
  {
    return this.lastEdited;
  }

  public void setLastEdited(Time lastEdited)
  {
    this.lastEdited = lastEdited;
  }
}

Best Regards

Chris

-----Original Message-----
From: Evan Ireland [mailto:[EMAIL PROTECTED]]
Sent: July 24, 2001 3:30 PM
To: [EMAIL PROTECTED]
Subject: Re: Base Class for Entity Bean


Can you give us a sample of what the AuditInfo class might look like?

Chris C wrote:
>
> Folks,
>
> Is it a good design / possible to create a base entity class for all my
> actual entity beans? Please advise.
>
> <example>
>         The base entity bean class (e.g. BaseEntity) is used to store all
> basic infomation (e.g. object id, revision no., audit information, etc.).
> And all my actual entity beans (e.g. PurchaseOrderCMP, QuotationCMP, etc.)
> inherits from this base class.
> </example>
>
> How I can store the information back the relational database (e.g. Oracle)
> if audit information is actually a javabean? I would think I can define
the
> audit information as an object in my ejb-jar.xml, however, a blob field
> would be used to store the whole object instead of individual attribute.
Is
> "OR-mapping" the only way to resolve this?
>
> <example>
>         BaseEntity -
>         objId           :String
>         revNo           :Long
>         auditInfo       :AuditInfo
>
>         where AuditInfo is a javabean
>
>         PurchaseOrderCMP extends BaseEntity
>         vendor          :Vendor
>         ...
>         /*
>         ** getter and setter of basic information should be handled by the
> BaseEntity
>         */
> </example>
>
> Thanks in advance.
>
> Chris
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

--
____________________________________________________________________________
____

Evan Ireland              Sybase EAServer Engineering
[EMAIL PROTECTED]
                            Wellington, New Zealand               +64 4
934-5856

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to