You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
this is my code
package io.codeclou.kitchen.duty.rest;
import com.atlassian.activeobjects.external.ActiveObjects;
import com.atlassian.plugins.rest.common.security.AnonymousAllowed;
import com.atlassian.sal.api.transaction.TransactionCallback;
import io.codeclou.kitchen.duty.ao.Week;
import javax.inject.Named;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
@Named
@Path("/planning")
public class KitchenDutyPlanningResource {
private ActiveObjects activeObjects;
public KitchenDutyPlanningResource(ActiveObjects activeObjects) {
this.activeObjects = activeObjects;
}
public KitchenDutyPlanningResource() {
}
@GET
@Path("/persistTest")
@Produces({MediaType.APPLICATION_JSON})
@AnonymousAllowed
public Response persistTest() {
activeObjects.executeInTransaction(new TransactionCallback<Week>()
{
@Override
public Week doInTransaction()
{
final Week testWeek = activeObjects.create(Week.class);
testWeek.setWeek(42);
testWeek.save();
return testWeek;
}
});
return Response.ok("ok").build();
}
@GET
@Path("/health")
@Produces({MediaType.APPLICATION_JSON})
@AnonymousAllowed
public Response health() {
return Response.ok("ok").build();
}
} and i got this error