Announcement Announcement Module
Collapse
No announcement yet.
Constructor arguments setup for Factory method Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Constructor arguments setup for Factory method

    Hi,

    I can not setup the factory method's constructor arguments
    I get this errors:Ambiguous factory method argument types - did you specify the correct bean references as factory method arguments?

    Code,

    <bean id="myFactory" class="cwsei.spring.dao.CategoryFactory" factory-method="findCategory">
    <constructor-arg type="java.lang.Enum" value="${categoryType}" />
    </bean>



    Here is my code:
    public abstract class Category {
    public abstract List list(int departId);
    ..
    }
    public class CategoryFactory {
    public enum CategoryType { firstclass,secondClass,...}
    public static Category findCategory(CategoryType categoryType) {
    ...
    }
    }
    Thanks,
    mkohan
Working...
X