|
| 1 | +/* |
| 2 | + * Copyright 2004-2010 the Seasar Foundation and the Others. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, |
| 13 | + * either express or implied. See the License for the specific language |
| 14 | + * governing permissions and limitations under the License. |
| 15 | + */ |
| 16 | +package example.entity; |
| 17 | + |
| 18 | +import java.math.BigDecimal; |
| 19 | +import java.util.ArrayList; |
| 20 | +import java.util.Collections; |
| 21 | +import java.util.HashMap; |
| 22 | +import java.util.List; |
| 23 | +import java.util.Map; |
| 24 | + |
| 25 | +import javax.annotation.Generated; |
| 26 | + |
| 27 | +import org.seasar.doma.jdbc.entity.AbstractEntityType; |
| 28 | +import org.seasar.doma.jdbc.entity.AssignedIdPropertyType; |
| 29 | +import org.seasar.doma.jdbc.entity.DefaultPropertyType; |
| 30 | +import org.seasar.doma.jdbc.entity.EntityPropertyType; |
| 31 | +import org.seasar.doma.jdbc.entity.GeneratedIdPropertyType; |
| 32 | +import org.seasar.doma.jdbc.entity.NamingType; |
| 33 | +import org.seasar.doma.jdbc.entity.PostDeleteContext; |
| 34 | +import org.seasar.doma.jdbc.entity.PostInsertContext; |
| 35 | +import org.seasar.doma.jdbc.entity.PostUpdateContext; |
| 36 | +import org.seasar.doma.jdbc.entity.PreDeleteContext; |
| 37 | +import org.seasar.doma.jdbc.entity.PreInsertContext; |
| 38 | +import org.seasar.doma.jdbc.entity.PreUpdateContext; |
| 39 | +import org.seasar.doma.jdbc.entity.Property; |
| 40 | +import org.seasar.doma.jdbc.entity.VersionPropertyType; |
| 41 | + |
| 42 | +@Generated("") |
| 43 | +public class _ImmutableEmp extends AbstractEntityType<ImmutableEmp> { |
| 44 | + |
| 45 | + private static _ImmutableEmp singleton = new _ImmutableEmp(); |
| 46 | + |
| 47 | + public final AssignedIdPropertyType<Object, ImmutableEmp, Integer, Object> id = new AssignedIdPropertyType<>( |
| 48 | + ImmutableEmp.class, Integer.class, Integer.class, |
| 49 | + () -> new org.seasar.doma.wrapper.IntegerWrapper(), null, null, |
| 50 | + "id", "ID", false); |
| 51 | + |
| 52 | + public final DefaultPropertyType<Object, ImmutableEmp, String, Object> name = new DefaultPropertyType<>( |
| 53 | + ImmutableEmp.class, String.class, String.class, |
| 54 | + () -> new org.seasar.doma.wrapper.StringWrapper(), null, null, |
| 55 | + "name", "NAME", true, true, false); |
| 56 | + |
| 57 | + public final DefaultPropertyType<Object, ImmutableEmp, BigDecimal, BigDecimal> salary = new DefaultPropertyType<>( |
| 58 | + ImmutableEmp.class, BigDecimal.class, BigDecimal.class, |
| 59 | + () -> new org.seasar.doma.wrapper.BigDecimalWrapper(), null, null, |
| 60 | + "salary", "SALARY", true, true, false); |
| 61 | + |
| 62 | + public final VersionPropertyType<Object, ImmutableEmp, Integer, Integer> version = new VersionPropertyType<>( |
| 63 | + ImmutableEmp.class, Integer.class, Integer.class, |
| 64 | + () -> new org.seasar.doma.wrapper.IntegerWrapper(), null, null, |
| 65 | + "version", "VERSION", false); |
| 66 | + |
| 67 | + private final String __name = "Emp"; |
| 68 | + |
| 69 | + private final String __catalogName = null; |
| 70 | + |
| 71 | + private final String __schemaName = null; |
| 72 | + |
| 73 | + private final String __tableName = "EMP"; |
| 74 | + |
| 75 | + private final NamingType __namingType = NamingType.UPPER_CASE; |
| 76 | + |
| 77 | + private final List<EntityPropertyType<ImmutableEmp, ?>> __idPropertyTypes; |
| 78 | + |
| 79 | + private final List<EntityPropertyType<ImmutableEmp, ?>> __entityPropertyTypes; |
| 80 | + |
| 81 | + private final Map<String, EntityPropertyType<ImmutableEmp, ?>> __entityPropertyTypeMap; |
| 82 | + |
| 83 | + private _ImmutableEmp() { |
| 84 | + List<EntityPropertyType<ImmutableEmp, ?>> __idList = new ArrayList<>(); |
| 85 | + __idList.add(id); |
| 86 | + __idPropertyTypes = Collections.unmodifiableList(__idList); |
| 87 | + List<EntityPropertyType<ImmutableEmp, ?>> __list = new ArrayList<>(); |
| 88 | + __list.add(id); |
| 89 | + __list.add(name); |
| 90 | + __list.add(salary); |
| 91 | + __list.add(version); |
| 92 | + __entityPropertyTypes = Collections.unmodifiableList(__list); |
| 93 | + Map<String, EntityPropertyType<ImmutableEmp, ?>> __map = new HashMap<>(); |
| 94 | + __map.put("id", id); |
| 95 | + __map.put("name", name); |
| 96 | + __map.put("salary", salary); |
| 97 | + __map.put("version", version); |
| 98 | + __entityPropertyTypeMap = Collections.unmodifiableMap(__map); |
| 99 | + } |
| 100 | + |
| 101 | + @Override |
| 102 | + public boolean isImmutable() { |
| 103 | + return false; |
| 104 | + } |
| 105 | + |
| 106 | + @Override |
| 107 | + public ImmutableEmp newEntity(Map<String, Property<ImmutableEmp, ?>> args) { |
| 108 | + return new ImmutableEmp((Integer) (args.containsKey("id") ? args.get( |
| 109 | + "id").get() : null), (String) (args.containsKey("name") ? args |
| 110 | + .get("name").get() : null), |
| 111 | + (BigDecimal) (args.containsKey("salary") ? args.get("salary") |
| 112 | + .get() : null), |
| 113 | + (Integer) (args.containsKey("version") ? args.get("version") |
| 114 | + .get() : null)); |
| 115 | + } |
| 116 | + |
| 117 | + @Override |
| 118 | + public Class<ImmutableEmp> getEntityClass() { |
| 119 | + return ImmutableEmp.class; |
| 120 | + } |
| 121 | + |
| 122 | + @Override |
| 123 | + public String getName() { |
| 124 | + return __name; |
| 125 | + } |
| 126 | + |
| 127 | + @Override |
| 128 | + public List<EntityPropertyType<ImmutableEmp, ?>> getEntityPropertyTypes() { |
| 129 | + return __entityPropertyTypes; |
| 130 | + } |
| 131 | + |
| 132 | + @Override |
| 133 | + public EntityPropertyType<ImmutableEmp, ?> getEntityPropertyType( |
| 134 | + String propertyName) { |
| 135 | + return __entityPropertyTypeMap.get(propertyName); |
| 136 | + } |
| 137 | + |
| 138 | + @Override |
| 139 | + public void saveCurrentStates(ImmutableEmp __entity) { |
| 140 | + } |
| 141 | + |
| 142 | + @Override |
| 143 | + public ImmutableEmp getOriginalStates(ImmutableEmp entity) { |
| 144 | + return null; |
| 145 | + } |
| 146 | + |
| 147 | + @Override |
| 148 | + public GeneratedIdPropertyType<Object, ImmutableEmp, ?, ?> getGeneratedIdPropertyType() { |
| 149 | + return null; |
| 150 | + } |
| 151 | + |
| 152 | + @Override |
| 153 | + public VersionPropertyType<Object, ImmutableEmp, ?, ?> getVersionPropertyType() { |
| 154 | + return version; |
| 155 | + } |
| 156 | + |
| 157 | + @Override |
| 158 | + public List<EntityPropertyType<ImmutableEmp, ?>> getIdPropertyTypes() { |
| 159 | + return __idPropertyTypes; |
| 160 | + } |
| 161 | + |
| 162 | + @Override |
| 163 | + public void preInsert(ImmutableEmp entity, |
| 164 | + PreInsertContext<ImmutableEmp> context) { |
| 165 | + } |
| 166 | + |
| 167 | + @Override |
| 168 | + public void preUpdate(ImmutableEmp entity, |
| 169 | + PreUpdateContext<ImmutableEmp> context) { |
| 170 | + } |
| 171 | + |
| 172 | + @Override |
| 173 | + public void preDelete(ImmutableEmp entity, |
| 174 | + PreDeleteContext<ImmutableEmp> context) { |
| 175 | + } |
| 176 | + |
| 177 | + @Override |
| 178 | + public void postInsert(ImmutableEmp entity, |
| 179 | + PostInsertContext<ImmutableEmp> context) { |
| 180 | + } |
| 181 | + |
| 182 | + @Override |
| 183 | + public void postUpdate(ImmutableEmp entity, |
| 184 | + PostUpdateContext<ImmutableEmp> context) { |
| 185 | + } |
| 186 | + |
| 187 | + @Override |
| 188 | + public void postDelete(ImmutableEmp entity, |
| 189 | + PostDeleteContext<ImmutableEmp> context) { |
| 190 | + } |
| 191 | + |
| 192 | + @Override |
| 193 | + public String getCatalogName() { |
| 194 | + return __catalogName; |
| 195 | + } |
| 196 | + |
| 197 | + @Override |
| 198 | + public String getSchemaName() { |
| 199 | + return __schemaName; |
| 200 | + } |
| 201 | + |
| 202 | + @Override |
| 203 | + public String getTableName() { |
| 204 | + return __tableName; |
| 205 | + } |
| 206 | + |
| 207 | + @Override |
| 208 | + public NamingType getNamingType() { |
| 209 | + return __namingType; |
| 210 | + } |
| 211 | + |
| 212 | + @Override |
| 213 | + public boolean isQuoteRequired() { |
| 214 | + return false; |
| 215 | + } |
| 216 | + |
| 217 | + public static _ImmutableEmp getSingletonInternal() { |
| 218 | + return singleton; |
| 219 | + } |
| 220 | +} |
0 commit comments