--- Scott Tavares <[EMAIL PROTECTED]> wrote:
>
> Whoa.. you have brought this thing along even
> further than i though you
> did... this is freaking cool! its giving me goose
> bumps to see this thing
> getting so close to actually being useful.
>
Turbine now has a demonstration system. But, really,
it needs hundreds of hours more to be useful for most
people. Finishing the work, adding tools, packaging,
and docs.
> as far as the "...one class map..." is how i got
> into that whole
> contestation with my new best buddy Brett ; ) I had
> started to code
> something but i've been compelled to re-think it
> all. You had mentioned that
> you have coded an example also, is this something
> you are planning to post
> up? I know that we've talked about using Jyve to
> base the example on, is
> this what you have been working on?... i'm just
> curious to know where you
> are.
I'm not currently adding anything to this. I'm too
busy. I'll give you a jyve data class and class map.
This leaves a sample and a db broker for you to
implement.
The data class is gratis from J.A. Carter's code gen,
very little hand-coding:
package org.apache.turbine.opl.examples;
/**
* Topic
*
* WARNING! Automatically generated file!
* Do not edit!
* Code Generator by J.A.Carter
*/
// JDK Classes
import java.sql.*;
// OPL Classes
import org.apache.turbine.opl.api.*;
public class Topic extends PersistentObject
{
Topic ()
{
super("org.apache.turbine.opl.examples.Topic");
}
/**
* Type : INT Name : TOPIC_ID
*/
protected int topic_id;
/**
* Type : TEXT Name : TOPIC_VALUE
*/
protected String topic_value;
/**
* Type : INT Name : FAQ_ID
*/
protected int faq_id;
/**
* Type : INT Name : VISITORID
*/
protected int visitorid;
/**
* Type : INT Name : DISPLAY_ORDER
*/
protected int display_order;
/**
* Type : CHAR(1) Name : DELETED
*/
protected String deleted;
/**
* Type : INT Name : DELETED_BY
*/
protected int deleted_by;
/**
* Type : INT Name : MODIFIED_BY
*/
protected int modified_by;
/**
* Type : TIMESTAMP Name : MODIFIED_DATE
*/
protected Timestamp modified_date;
/**
* Sets the value for topic_id
*/
public void setTopic_id(int topic_id)
{
this.topic_id=topic_id;
}
/**
* Gets the value for topic_id
*/
public int getTopic_id()
{
return topic_id;
}
/**
* Sets the value for topic_value
*/
public void setTopic_value(String topic_value)
{
this.topic_value=topic_value;
}
/**
* Gets the value for topic_value
*/
public String getTopic_value()
{
return topic_value;
}
/**
* Sets the value for faq_id
*/
public void setFaq_id(int faq_id)
{
this.faq_id=faq_id;
}
/**
* Gets the value for faq_id
*/
public int getFaq_id()
{
return faq_id;
}
/**
* Sets the value for visitorid
*/
public void setVisitorid(int visitorid)
{
this.visitorid=visitorid;
}
/**
* Gets the value for visitorid
*/
public int getVisitorid()
{
return visitorid;
}
/**
* Sets the value for display_order
*/
public void setDisplay_order(int display_order)
{
this.display_order=display_order;
}
/**
* Gets the value for display_order
*/
public int getDisplay_order()
{
return display_order;
}
/**
* Sets the value for deleted
*/
public void setDeleted(String deleted)
{
this.deleted=deleted;
}
/**
* Gets the value for deleted
*/
public String getDeleted()
{
return deleted;
}
/**
* Sets the value for deleted_by
*/
public void setDeleted_by(int deleted_by)
{
this.deleted_by=deleted_by;
}
/**
* Gets the value for deleted_by
*/
public int getDeleted_by()
{
return deleted_by;
}
/**
* Sets the value for modified_by
*/
public void setModified_by(int modified_by)
{
this.modified_by=modified_by;
}
/**
* Gets the value for modified_by
*/
public int getModified_by()
{
return modified_by;
}
/**
* Sets the value for modified_date
*/
public void setModified_date(Timestamp modified_date)
{
this.modified_date=modified_date;
}
/**
* Gets the value for modified_date
*/
public Timestamp getModified_date()
{
return modified_date;
}
}
Here's the class map.
import org.apache.turbine.opl.mapping.*;
/**
*
* @author George Stewart
*
*/
public class TopicClassMap {
public TopicClassMap() {
}
public static ClassMap create()
{
ClassMap classMap = new
ClassMap("org.apache.turbine.opl.examples.Topic");
TableMap tableMap = new TableMap("topic");
String [] columnNames = {"topic_id",
"topic_value", "faq_id",
"visitorid",
"display_order", "deleted",
"deleted_by",
"modified_by", "modified_date" };
String [] attributeNames = {"topic_id",
"topic_value", "faq_id",
"visitorid",
"display_order", "deleted",
"deleted_by",
"modified_by", "modified_date" };
int [] types = {Types.INTEGER, Types.VARCHAR,
Types.INTEGER,
Types.INTEGER, Types.INTEGER,
Types.VARCHAR,
Types.INTEGER, Types.INTEGER,
Types.TIMESTAMP};
for (int i=0; i<columnNames.length; i++)
{
AttributeMap attributeMap = new
AttributeMap(attributeNames[i]);
ColumnMap columnMap = new
ColumnMap(columnNames[i]);
columnMap.setType(types[i]);
columnMap.setTableMap(tableMap);
if
(columnMap.getName().equals("topic_id"))
columnMap.setIsKeyColumn(true);
attributeMap.setColumnMap(columnMap);
classMap.addAttributeMap(attributeMap);
}
return classMap;
}
}
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]