You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Heiko Stehli <he...@hm-informatik.de> on 2002/12/11 11:42:24 UTC

Creating of my own TurbineMapBuilder failed

I want to change the table names of the turbine user tables because these
names are too long for Informix databases (the limitation is 18 characters).
I extends the TurbineMapBuilder class and implements my own methods (see
example). After that I change my TurbineResources.properties file with

database.maps.builder=de.baw.wadaba.om.map.WadabaMapBuilder.


public class WadabaMapBuilder extends TurbineMapBuilder
{
  /**
   * Get the User table.
   *
   * @return A String.
   */
  public String getTableUser()
  {
    return "B_USER";
  }

  /**
   * Get the UserRole table.
   *
   * @return A String.
   */
  public String getTableRole()
  {
    return "B_ROLE";
  }

  /**
   * Get the Permission table.
   *
   * @return A String.
   */
  public String getTablePermission()
  {
    return "B_PERMISSION";
  }

  /**
   * Get the UserGroupRole table.
   *
   * @return A String.
   */
  public String getTableUserGroupRole()
  {
    return "B_USER_GROUP_ROLE";
  }

  /**
   * Get the RolePermission table.
   *
   * @return A String.
   */
  public String getTableRolePermission()
  {
    return "B_ROLE_PERMISSION";
  }

  /**
   * Get the Group table.
   *
   * @return A String.
   */
  public String getTableGroup()
  {
    return "B_GROUP";
  }

  /**
   * Get the Jobentry table.
   *
   * @return A String.
   */
  public String getTableJobentry()
  {
    return "B_SCHEDULED_JOB";
  }
}

After starting the application this map builder was never created. I look
into the turbine source files and found only a definition MAPS_BUILDER for
the property "database.maps.builder" in TurbineConstants.java. These
constant is never used on other places.
In the peer classes I found the following code.

public class GroupPeer extends BasePeer
{
    private static final TurbineMapBuilder mapBuilder =
        (TurbineMapBuilder)
getMapBuilder("org.apache.turbine.util.db.map.TurbineMapBuilder");

    /** The table name for this peer. */
    private static final String TABLE_NAME = mapBuilder.getTableGroup();

    /** The column name for the Group id field. */
    public static final String GROUP_ID = mapBuilder.getGroup_GroupId();

    /** The column name for the name field. */
    public static final String NAME = mapBuilder.getGroup_Name();

    /** The column name for the ObjectData field */
    public static final String OBJECTDATA =
mapBuilder.getGroup_ObjectData();

    /** The Oracle sequence name for this peer. */
    private static final String SEQUENCE_NAME =
mapBuilder.getSequenceGroup();

...
}

I think that my map builder can't be created with this implementation. What
must I do to get this all to work?


Regards

Heiko


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Creating of my own TurbineMapBuilder failed

Posted by Rodney Schneider <ro...@actf.com.au>.
On Wed, 11 Dec 2002 21:42, you wrote:
> I want to change the table names of the turbine user tables because
> these names are too long for Informix databases (the limitation is 18
> characters).

I remember this problem being discussed a very long time ago, back 
before the first Turbine release (I think John McNally was the one who 
fixed this problem), but I can't remember how he did it :(

You might have some luck searching the mailing list archives or asking 
on the torque-dev mailing list.

Regards,

-- Rodney

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>