001package org.andromda.cartridges.ejb.metafacades;
002
003import org.andromda.cartridges.ejb.EJBProfile;
004
005/**
006 * MetafacadeLogic implementation for org.andromda.cartridges.ejb.metafacades.EJBAssociationFacade.
007 *
008 * @see org.andromda.cartridges.ejb.metafacades.EJBAssociationFacade
009 */
010public class EJBAssociationFacadeLogicImpl
011        extends EJBAssociationFacadeLogic
012{
013    private static final long serialVersionUID = 34L;
014    // ---------------- constructor -------------------------------
015
016    /**
017     * @param metaObject
018     * @param context
019     */
020    public EJBAssociationFacadeLogicImpl(Object metaObject, String context)
021    {
022        super(metaObject, context);
023    }
024
025    // --------------- attributes ---------------------
026    /**
027     * @return findTaggedValue(EJBProfile.TAGGEDVALUE_EJB_TRANSACTION_TYPE)
028     * @see org.andromda.cartridges.ejb.metafacades.EJBAssociationFacade#getTransactionType()
029     */
030    protected String handleGetTransactionType()
031    {
032        return (String)this.findTaggedValue(EJBProfile.TAGGEDVALUE_EJB_TRANSACTION_TYPE);
033    }
034
035    /**
036     * @return tableName
037     * @see org.andromda.cartridges.ejb.metafacades.EJBAssociationFacadeLogic#getTableName()
038     */
039    public String getTableName()
040    {
041        String tableName = super.getTableName();
042        if (getName().toLowerCase().startsWith(tableName.toLowerCase()))
043        {
044            tableName = getRelationName().replaceAll("-", "_").toUpperCase();
045        }
046        return tableName;
047    }
048}