I experienced the same problem some time ago in a project. However, since I could not find a way to solve this problem using fixtures (since the database stores the blob object as a string, as described above), I created a workaround to at least solve this problem in a test scenario. I created the following file /app/job/Bootstrap.java:
import play.test.*;
import play.jobs.*;
import play.db.DB;
import models.*;
import java.util.List;
@OnApplicationStart
public class Bootstrap extends Job {
public void doJob() {
if(Item.count() == 0) {
Fixtures.loadModels("my_fixtures.yml");
List<Item> allItems = Item.findAll();
for (Item a: allItems){
DB.execute("UPDATE `Item` SET image='item_" + a.name.toLowerCase() + ".png|image/png' WHERE id=" + a.getId());
}
}
}
}
, , - , "Item".
- "", ! , my_fixtures.yml. , .
, OP, .
EDIT: , , application.conf, : "item_ <item_name_in_lowercase > " ".png"