Automapper : mapping issue with inheritance and abstract base class on collections with Entity Framework 4 Proxy Pocos

This answer comes ‘a bit’ late as I’ve just faced the same issue with EF4 POCO proxies. I solved it using a custom converter that calls Mapper.DynamicMap<TDestination>(object source) to invoke the runtime type conversion, rather than the .Include<TOtherSource, TOtherDestinatio>(). It works fine for me. In your case you would define the following converter: class PaymentConverter … Read more

Converting ArrayList of Characters to a String?

You can iterate through the list and create the string. String getStringRepresentation(ArrayList<Character> list) { StringBuilder builder = new StringBuilder(list.size()); for(Character ch: list) { builder.append(ch); } return builder.toString(); } Setting the capacity of the StringBuilder to the list size is an important optimization. If you don’t do this, some of the append calls may trigger an … Read more

Creating an Observable List/Collection

Use the factory methods in FXCollections: ObservableList<String> list = FXCollections.observableArrayList(); The unsafe operation in your choice box constructor is because you haven’t specified the type for the choice box: ChoiceBox<String> box = new ChoiceBox<>(FXCollections.observableArrayList(“Asparagus”, “Beans”, “Broccoli”, “Cabbage” , “Carrot”, “Celery”, “Cucumber”, “Leek”, “Mushroom” , “Pepper”, “Radish”, “Shallot”, “Spinach”, “Swede” , “Turnip”)); and the error from … Read more

How can I convert Scala Map to Java Map with scala.Float to java.Float k/v conversion

The solution linked to by @pagoda_5b works: Scala convert List[Int] to a java.util.List[java.lang.Integer] scala> import collection.JavaConversions._ import collection.JavaConversions._ scala> val m = mapAsJavaMap(Map(1 -> 2.1f)).asInstanceOf[java.util.Map[java.lang.Integer, java.lang.Float]] m: java.util.Map[Integer,Float] = {1=2.1} scala> m.get(1).getClass res2: Class[_ <: Float] = class java.lang.Float

Hibernate Validation of Collections of Primitives

Neither JSR-303 nor Hibernate Validator has any ready-made constraint that can validate each elements of Collection. One possible solution to address this issue is to create a custom @ValidCollection constraint and corresponding validator implementation ValidCollectionValidator. To validate each element of collection we need an instance of Validator inside ValidCollectionValidator; and to get such instance we … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)