resource.setUuid("" + new Random().nextInt());
resource.setVersion("1.0");
em.persist(resource);
// Product versions
productVersion1 = new ProductVersion();
productVersion1.setVersion("1.0");
productVersion1.setResourceType(resourceType);
em.persist(productVersion1);
resource.setProductVersion(productVersion1);
productVersion2 = new ProductVersion();
productVersion2.setVersion("2.0");
productVersion2.setResourceType(resourceType);
em.persist(productVersion2);
// Add package types to resource type