001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portlet.dynamicdatamapping.model.impl;
016    
017    import com.liferay.portal.kernel.util.StringBundler;
018    import com.liferay.portal.model.CacheModel;
019    
020    import com.liferay.portlet.dynamicdatamapping.model.DDMStructureLink;
021    
022    import java.io.Externalizable;
023    import java.io.IOException;
024    import java.io.ObjectInput;
025    import java.io.ObjectOutput;
026    
027    /**
028     * The cache model class for representing DDMStructureLink in entity cache.
029     *
030     * @author Brian Wing Shun Chan
031     * @see DDMStructureLink
032     * @generated
033     */
034    public class DDMStructureLinkCacheModel implements CacheModel<DDMStructureLink>,
035            Externalizable {
036            @Override
037            public String toString() {
038                    StringBundler sb = new StringBundler(9);
039    
040                    sb.append("{structureLinkId=");
041                    sb.append(structureLinkId);
042                    sb.append(", classNameId=");
043                    sb.append(classNameId);
044                    sb.append(", classPK=");
045                    sb.append(classPK);
046                    sb.append(", structureId=");
047                    sb.append(structureId);
048                    sb.append("}");
049    
050                    return sb.toString();
051            }
052    
053            @Override
054            public DDMStructureLink toEntityModel() {
055                    DDMStructureLinkImpl ddmStructureLinkImpl = new DDMStructureLinkImpl();
056    
057                    ddmStructureLinkImpl.setStructureLinkId(structureLinkId);
058                    ddmStructureLinkImpl.setClassNameId(classNameId);
059                    ddmStructureLinkImpl.setClassPK(classPK);
060                    ddmStructureLinkImpl.setStructureId(structureId);
061    
062                    ddmStructureLinkImpl.resetOriginalValues();
063    
064                    return ddmStructureLinkImpl;
065            }
066    
067            @Override
068            public void readExternal(ObjectInput objectInput) throws IOException {
069                    structureLinkId = objectInput.readLong();
070                    classNameId = objectInput.readLong();
071                    classPK = objectInput.readLong();
072                    structureId = objectInput.readLong();
073            }
074    
075            @Override
076            public void writeExternal(ObjectOutput objectOutput)
077                    throws IOException {
078                    objectOutput.writeLong(structureLinkId);
079                    objectOutput.writeLong(classNameId);
080                    objectOutput.writeLong(classPK);
081                    objectOutput.writeLong(structureId);
082            }
083    
084            public long structureLinkId;
085            public long classNameId;
086            public long classPK;
087            public long structureId;
088    }