@@ -0,0 +1,2315 @@
+/*%0A * Copyright (C) 2004-2006  exedio GmbH (www.exedio.com)%0A *%0A * This library is free software; you can redistribute it and/or%0A * modify it under the terms of the GNU Lesser General Public%0A * License as published by the Free Software Foundation; either%0A * version 2.1 of the License, or (at your option) any later version.%0A *%0A * This library is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU%0A * Lesser General Public License for more details.%0A *%0A * You should have received a copy of the GNU Lesser General Public%0A * License along with this library; if not, write to the Free Software%0A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA%0A */%0A%0Apackage com.exedio.cope.pattern;%0A%0Aimport com.exedio.cope.IntegerAttribute;%0Aimport com.exedio.cope.Item;%0Aimport com.exedio.cope.ItemAttribute;%0Aimport com.exedio.cope.SetValue;%0Aimport com.exedio.cope.StringAttribute;%0Aimport com.exedio.cope.Type;%0Aimport com.exedio.cope.UniqueConstraint;%0Aimport com.exedio.cope.util.ReactivationConstructorDummy;%0A%0Apublic final class DEnumValue extends Item%0A%7B%0A%09public static final ItemAttribute%3CDAttribute%3E parent = newItemAttribute(FINAL, DAttribute.class, CASCADE);%0A%0A%09public static final IntegerAttribute position = new IntegerAttribute(FINAL);%0A%09public static final UniqueConstraint uniquePosition = new UniqueConstraint(parent, position);%0A%09%0A%09public static final StringAttribute code = new StringAttribute(FINAL);%0A%09public static final UniqueConstraint uniqueCode = new UniqueConstraint(parent, code);%0A%09%0A%09DEnumValue(final DAttribute parent, final int position, final String code)%0A%09%7B%0A%09%09super(new SetValue%5B%5D%7B%0A%09%09%09%09DEnumValue.parent.map(parent),%0A%09%09%09%09DEnumValue.position.map(position),%0A%09%09%09%09DEnumValue.code.map(code),%0A%09%09%7D);%0A%09%7D%0A%09%0A%09private DEnumValue(final SetValue%5B%5D initialAttributes)%0A%09%7B%0A%09%09super(initialAttributes);%0A%09%7D%0A%09%0A%09private DEnumValue(final ReactivationConstructorDummy d, final int pk)%0A%09%7B%0A%09%09super(d, pk);%0A%09%7D%0A%09%0A%09public DAttribute getParent()%0A%09%7B%0A%09%09return parent.get(this);%0A%09%7D%0A%09%0A%09public int getPosition()%0A%09%7B%0A%09%09return position.getMandatory(this);%0A%09%7D%0A%09%0A%09public String getCode()%0A%09%7B%0A%09%09return code.get(this);%0A%09%7D%0A%09%0A%09public static final Type%3CDEnumValue%3E TYPE = newType(DEnumValue.class);%0A%7D%0A

fix for: add enum attributes to dynamic type systems