/****************************************************************
 * Licensed to the Apache Software Foundation (ASF) under one   *
 * or more contributor license agreements.  See the NOTICE file *
 * distributed with this work for additional information        *
 * regarding copyright ownership.  The ASF licenses this file   *
 * to you under the Apache License, Version 2.0 (the            *
 * "License"); you may not use this file except in compliance   *
 * with the License.  You may obtain a copy of the License at   *
 *                                                              *
 *   http://www.apache.org/licenses/LICENSE-2.0                 *
 *                                                              *
 * Unless required by applicable law or agreed to in writing,   *
 * software distributed under the License is distributed on an  *
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
 * KIND, either express or implied.  See the License for the    *
 * specific language governing permissions and limitations      *
 * under the License.                                           *
 ****************************************************************/

package org.apache.james.mailbox.torque.om;

import java.util.ArrayList;
import java.util.List;

import org.apache.torque.TorqueException;
import org.apache.torque.om.Persistent;

/**
 * The skeleton for this class was autogenerated by Torque on:
 * 
 * [Wed Sep 06 11:15:19 CEST 2006]
 * 
 * You should add additional methods to this class to meet the application
 * requirements. This class will only be generated as long as it does not
 * already exist in the output directory.
 *
 *
 * @deprecated Torque implementation will get removed in the next release
 */
@Deprecated()
public class MessageRow extends
        org.apache.james.mailbox.torque.om.BaseMessageRow implements
        Persistent {
    /**
     * 
     */
    private static final long serialVersionUID = -75081490028686786L;

    public MessageRow() {
    }

    public MessageFlags getMessageFlags() throws TorqueException {
        MessageFlags mf = null;
        List l = getMessageFlagss();
        if (l.size() == 1) {
            mf = (MessageFlags) l.get(0);
        }
        return mf;
    }

    public void setMessageFlags(MessageFlags messageFlags) {
        this.collMessageFlagss = new ArrayList(1);
        collMessageFlagss.add(messageFlags);
    }

    public byte[] getBodyContent() throws TorqueException {
        final MessageBody body = (MessageBody) getMessageBodys().get(0);
        final byte[] result = body.getBody();
        return result;
    }
}
