001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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    }