Hi i having problem with deleting of an entity. The entitymanager would not remove the entity. Do anyone see the error in the code?
Error message:
java.lang.AssertionError:
Expected :null
Actual :Account{id=1, customer=Customer{customerId=1, firstName='Kim', lastName='Pedersen', email='kim#yahoo.no', phoneNumber='90045870', birth=1980-11-05 00:00:00.0}, login= 'Login{Id=1, username='kimPedda', password='kimSimDimSum'}}
#Entity
#NamedQuery(name = "Account.getAll", query = "select a from Account a")
#SequenceGenerator(name = "SEQ_ACC", initialValue = 50)
public class Account {
#Id
#GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_ACC")
private int id;
#OneToOne(cascade = CascadeType.ALL)//, fetch = FetchType.EAGER)
#JoinColumn(name = "FK_CUSTOMER")
private Customer customer;
#OneToOne(cascade = CascadeType.ALL)
#JoinColumn(name = "FK_LOGIN")
private Login login;
/*
-------------------------------------------
CONSTRUCTORS
-------------------------------------------
*/
public Account(Customer customer, Login login) {
this.customer = customer;
this.login = login;
}
public Account() {
}
// ======================================
// = GET AND SET =
// ======================================
public Customer getCustomer() {
return customer;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public void setCustomer(Customer customer) {
this.customer = customer;
}
public Login getLogin() {
return login;
}
public void setLogin(Login login) {
this.login = login;
}
// ======================================
// = TO STRING =
// ======================================
#Override
public String toString() {
return "Account{" +
"id=" + id +
", customer=" + customer +
", login= '" + login +
'}';
}
}
public class JpaAccountDao implements AccountDao {
#PersistenceContext(unitName = "account")
private EntityManager entityManager;
public JpaAccountDao() {
}
public JpaAccountDao(EntityManager entityManager){
this.entityManager = entityManager;
}
#Override
public Account persist(Account account) {
if( account == null )
throw new IllegalArgumentException("No account could be created!");
entityManager.persist(account);
return account;
}
#Override
public Boolean delete(int id) {
if( id != 0) {
Account account = entityManager.find(Account.class,id);
entityManager.remove(account);
return true;
}
throw new IllegalArgumentException(String.format("Account with id-nr:{%d] could not be deleted =C ", id ));
}
#Override
public Account findById(int id) {
if( id <= 0 )
throw new IllegalArgumentException("No id was found!");
return entityManager.find(Account.class, id);
}
#Override
public List<Account> getAll() {
TypedQuery<Account> query = entityManager.createNamedQuery("Account.getAll", Account.class);
return query.getResultList();
}
}
public class AccountServiceIT {
private EntityManager entityManager;
private EntityManagerFactory factory;
private JpaAccountDao jpaAccountDao;
private JpaCustomerDao jpaCustomerDao;
private CustomerTestCase customerTestCase;
private JpaLoginDao jpaLoginDao;
private Account account;
private Account account2;
#Before
public void setup() throws Exception {
factory = Persistence.createEntityManagerFactory("TEST");
entityManager = factory.createEntityManager();
jpaAccountDao = new JpaAccountDao(entityManager);
account = new Account();
account2 = new Account();
}
#After
public void tearDown() throws Exception {
entityManager.close();
factory.close();
}
/*
Delete a account popularized via the init.script
*/
// TODO CREATE A TESTE THATS RUNS
#Test
public void deleteAccountTest() throws Exception {
Account account = entityManager.find(Account.class, 1);
entityManager.getTransaction().begin();
boolean result = jpaAccountDao.delete(account.getId());
entityManager.getTransaction().commit();
Account res = jpaAccountDao.findById(1);
assertEquals(res, account);
assertNull(result);
}
}
(Init.script)
INSERT INTO BOOK (id, title, price, description, number, instantiationDate) VALUES (1,'Mio min Mio', 100.0, 'Book about two brothers', '8-321389213', '2016-05-11 23:42:21');
INSERT INTO BOOK (id, title, price, description, number, instantiationDate ) VALUES (2, 'Franks dagbok', 10.0, 'About the war and Auchwitch', '13-321321321', '2016-11-05 20:00:00' );
INSERT INTO CUSTOMER (FK_CUSTOMER, firstName, lastName, email, phoneNumber, birth) VALUES (1, 'Kim', 'Pedersen','kim#yahoo.no','90045870', '1980-11-05');
INSERT INTO CUSTOMER (FK_CUSTOMER, firstName, lastName, email, phoneNumber, birth) VALUES (2, 'Silje', 'Kyrra','silje#yahoo.no','45236585', '1999-1-15');
INSERT INTO LOGIN (FK_LOGIN, username,password ) VALUES (1,'kimPedda', 'kimSimDimSum');
INSERT INTO LOGIN (FK_LOGIN, username,password ) VALUES (2,'Silkyra', 'SanriKorraDigo');
INSERT INTO ACCOUNT (id, FK_CUSTOMER, FK_LOGIN ) VALUES (1, 1, 1 );
INSERT INTO ACCOUNT (id, FK_CUSTOMER, FK_LOGIN ) VALUES (2, 2, 2 );
I just figure it out. It was an error with my testfile =)
I needed to change the method to get a instance, and delete with the method rather than through entityManager =)
Case solved
Related
Please be so kind to help me understand why, by running attached code, I have multiple records been written in parent table from my data base (MySQL) with corresponding to a record in related table, although the set up in Java code is for one to one relation (i.e. one records in parent corresponding to only one record in other related table.
I am at your disposal for any questions you might have on the subject.
many thank for support
petrisor
public class Main {
public static void main(String[] args) {
createParkingLot();
AddEmployees(1);
AddEmployees(2);
}
public static void createParkingLot(){
EntityManagerFactory emf =
Persistence.createEntityManagerFactory("java2curs4e1PU");
EntityManager em = emf.createEntityManager();
ParkingLot p1= new ParkingLot();
p1.setParking_lot_no(1);
try{
em.getTransaction().begin();
em.persist(p1);
em.getTransaction().commit();
} finally {
em.close();
emf.close();
}
}
public static void AddEmployees(int employee_number){
EntityManagerFactory emf =
Persistence.createEntityManagerFactory("java2curs4e1PU");
EntityManager em = emf.createEntityManager();
ParkingLot p2 = em.find(ParkingLot.class,1);
Employee a1 = new Employee();
a1.setEmployee_name("Employee_name_#"+employee_number);
a1.setParking_lot(p2);
try{
em.getTransaction().begin();
em.persist(a1);
em.getTransaction().commit();
} finally {
em.close();
emf.close();
}
}
}
+++++++++++++++++++++++++++++
related entities description:
+++++++++++++++++++++++++++++
Entity Employee
+++++++++++++++++++++++++++++
#Entity
#Table(name = "employees")
public class Employee implements Serializable{
#Id
#GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
private String employee_name;
#OneToOne(cascade = CascadeType.ALL,optional = false,fetch =
FetchType.LAZY)
#JoinColumn(name = "id_parking_lot")
private ParkingLot parking_lot;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getEmployee_name() {
return employee_name;
}
public void setEmployee_name(String employee_name) {
this.employee_name = employee_name;
}
public ParkingLot getParking_lot() {
return parking_lot;
}
public void setParking_lot(ParkingLot parking_lot) {
this.parking_lot = parking_lot;
}
#Override
public String toString() {
return "Employee{" + "id=" + id + ", name=" + employee_name + ",
parking lot=" + parking_lot + '}';
}
}
++++++++++++++++++++++++++++
Entity ParkingLot:
++++++++++++++++++++++++++++
#Entity
#Table(name = "parking_lots")
public class ParkingLot implements Serializable{
#Id
#GeneratedValue(strategy = GenerationType.IDENTITY )
private int id;
private int parking_lot_no;
#OneToOne(cascade = CascadeType.ALL,fetch = FetchType.LAZY,optional =
false,mappedBy = "parking_lot")
private Employee employee;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getParking_lot_no() {
return parking_lot_no;
}
public void setParking_lot_no(int parking_lot_no) {
this.parking_lot_no = parking_lot_no;
}
public Employee getEmployee() {
return employee;
}
public void setEmployee(Employee employee) {
this.employee = employee;
}
#Override
public String toString() {
return "ParkingLot{" + "id=" + id + ", parking lot number=" +
parking_lot_no + '}';
}
}
Normally I would expect the program to through an exception as I tried to insert another Employee (Employee_name_#2) with the same parking lot (id 1).
Instead in table employees I found that I have 2 employees with same parking lot.
I have a User Entity and an Order Entity.
One of the field in order entity is date.
Till now i have the user enter the date.
Now i want that at the time post request is made the date is automatically set to the current date and stored in the database.
Tried using #Prepersist annotation But since this is my first API that i am developing using springBoot , I don't really know how to use it.
User Entity
#Entity
public class User {
#Id
#GeneratedValue(strategy=GenerationType.AUTO)
private BigInteger id;
#NotEmpty(message = "Name is compulsory")
#Pattern(regexp="^[A-Za-z]*[A-Za-z-'. ]*[A-Za-z]*$",message = "Name has invalid characters")
private String username;
//#NotEmpty(message = "Phone Number is compulsary")
#Range(min = 6400000000L ,max=9999999999L)
private Long phoneNumber;
#NotEmpty(message = "Address is compulsary")
private String address;
public User(){}
public User(BigInteger id, String username, Long phoneNumber, String address) {
super();
this.id = id;
this.username = username;
this.phoneNumber = phoneNumber;
this.address = address;
}
public BigInteger getId() {
return id;
}
public void setId(BigInteger id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public Long getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(Long phoneNumber) {
this.phoneNumber = phoneNumber;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
}
Order Entity
#Entity
public class Orders {
#Id
#GeneratedValue(strategy=GenerationType.AUTO)
private BigInteger id;
#CreationTimestamp
#Temporal(TemporalType.TIMESTAMP)
private Date date;
#ManyToOne
private User user;
public Orders(){}
public Orders(BigInteger id, Date date,BigInteger userId) {
super();
this.id = id;
this.date = date;
this.user=new User(userId," ",0000000000L," ");
}
public BigInteger getId() {
return id;
}
public void setId(BigInteger id) {
this.id = id;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
}
Order Controller
#RestController
public class OrdersController {
#Autowired
private OrdersService ordersService;
#ApiOperation(value="Show all orders")
#RequestMapping("/orders")
public Iterable<Orders> getAllOrders()
{
return ordersService.getAllOrders();
}
#ApiOperation(value="Show a particular Order")
#RequestMapping("/orders/{orderId}")
public Orders getOrderById(#PathVariable BigInteger orderId)
{
return ordersService.getOrderById(orderId);
}
#ApiOperation(value="Show all orders of a particular User")
#RequestMapping("/users/{id}/orders")
public List<Orders> getOrders(#PathVariable BigInteger id) {
return ordersService.getOrders(id);
}
#ApiOperation(value="Show an order for a User")
#RequestMapping("/users/{userId}/orders/{id}")
public Orders getOrder(#PathVariable BigInteger id){
return ordersService.getOrder(id);
}
#ApiOperation(value="Adds a new Order")
#RequestMapping(method = RequestMethod.POST,value = "/users/{userId}/orders")
public Orders addOrder(#PathVariable BigInteger userId,#RequestBody Orders orders) {
orders.setUser(new User(userId," ",0000000000L," "));
return ordersService.addOrder(orders);
}
#ApiOperation(value="Alter an Order")
#RequestMapping(method = RequestMethod.PUT, value="/users/{userId}/orders/{id}")
public Orders updateOrder(#RequestBody Orders order,#PathVariable BigInteger id,#PathVariable BigInteger userId)throws Exception {
order.setUser(new User(userId," ",0000000000L," "));
return ordersService.updateOrder(order, id);
}
#ApiOperation(value="Delete an Order")
#RequestMapping(method = RequestMethod.DELETE, value="/orders/{id}")
public void deleteOrder(#PathVariable BigInteger id){
ordersService.deleteOrder(id);
}
}
#PrePersist is a JPA annotation and therefore should work in all compatible persistence frameworks. It indicates a method that should be invoked on particular entity lifecycle event. (Other events are well documented in the Hibernate user guide here).
Add this to your entity:
#Temporal(TemporalType.TIMESTAMP)
#Column(nullable = false)
private Date timestamp;
#PrePersist
private void onCreate() {
timestamp = new Date();
}
As for assigning/creating the entity in the controller, it is a good practice to use DTO (data transfer objects) in your controller (#RequestBody OrderDto orderDto) and then use some method to populate a new entity instance with those values. Most common options are
modelmapper
manually
...
Order o = new Order();
o.user = userDao.findById(orderDto.getUserId());
...
// persist o
I have two entities - Group and UserGroup, they are connected with groupId.
"\" are because postgre is case sensitive and this way we correct this fact.
#Entity
#Table(name = "\"Group\"")
public class Group {
#Id
#GeneratedValue(strategy = GenerationType.AUTO)
#Column(name = "\"groupId\"")
private int groupId;
#Column(name = "\"groupName\"")
private String groupName;
#OneToMany(mappedBy = "group")
List<Project> projects;
#OneToMany(mappedBy = "group")
private List<UserGroup> members;
public Group(String groupName) {
this.groupName = groupName;
}
public Group() {
}
public int getGroupId() {
return groupId;
}
public void setGroupId(int groupId) {
this.groupId = groupId;
}
public String getGroupName() {
return groupName;
}
public void setGroupName(String groupName) {
this.groupName = groupName;
}
public List<Project> getProjects() {
return projects;
}
public void setProjects(List<Project> projects) {
this.projects = projects;
}
public List<UserGroup> getMembers() {
return members;
}
public void setMembers(List<UserGroup> members) {
this.members = members;
}
#Override
public String toString() {
return "Group{" +
"groupId=" + groupId +
", groupName='" + groupName + '\'' +
'}';
}
}
And UserGroup
#Entity
#Table(name = "\"UserGroup\"")
#IdClass(GroupAssociationId.class)
public class UserGroup {
#Id
#Column(name = "\"userId\"")
private int userId;
#Id
#Column(name = "\"groupId\"")
private int groupId;
#ManyToOne
#PrimaryKeyJoinColumn(name = "\"userId\"", referencedColumnName = "\"userId\"")
private User member;
#ManyToOne
#PrimaryKeyJoinColumn(name = "\"groupId\"", referencedColumnName = "\"groupId\"")
private Group group;
#ManyToOne
#JoinColumn(name = "\"accessId\"")
private Access access;
public UserGroup(Group group, User member, Access access) {
this.group = group;
this.member = member;
this.access = access;
}
public UserGroup() {
}
public int getUserId() {
return userId;
}
public void setUserId(int userId) {
this.userId = userId;
}
public int getGroupId() {
return groupId;
}
public void setGroupId(int groupId) {
this.groupId = groupId;
}
public User getMember() {
return member;
}
public void setMember(User member) {
this.member = member;
}
public Group getGroup() {
return group;
}
public void setGroup(Group group) {
this.group = group;
}
public Access getAccess() {
return access;
}
public void setAccess(Access access) {
this.access = access;
}
#Override
public String toString() {
return "UserGroup{" +
"userId=" + userId +
", groupId=" + groupId +
", access=" + access.getAccessName() +
'}';
}
}
When I try to create a row in a table UserGroup I get a mistake:
Caused by: org.postgresql.util.PSQLException: ERROR: column "group_groupId" of relation "UserGroup" does not exist
Why? This happens on the string "em.getTransaction().commit(). It is really strange.
In the table UserGroup, a column:
"group_`groupId`"
was generated (because you are using "" to preserve case sensitive.
You can edit in postgres the name for the column (and the foreing key too):
"group_`groupId`" ---> "group_groupId"
JPA is looking for group_groupId.
I've managed to answer this question. The problem was in sequence generation. When generating in embedded database, I don't know why, the generation type sequence doesn't work. Instead I used Identity type and everything started working
I was developing an EJB application using netbeans which manages Hotel Bookings. I realised that the em.merge() function of the Entity manager inserts a new record in the database instead of updating if the primary key or the #Id of the entity is set to autogenerated.
I have two entities - Booking and Room. The ID for Booking is autogenerated whereas for Room its not autogenerated. The same merge() function in the session bean inserts a new row for Booking but updates for Room.
My Entity beans and session beans are as follows:-
Booking Entity
#SequenceGenerator(name="booking_seq", initialValue=1, allocationSize=100)
#Entity
#NamedQueries({#NamedQuery(name="Booking.getAll",query="SELECT e FROM Booking e order by e.bookingId")})
public class Booking implements Serializable {
private static final long serialVersionUID = 1L;
#Id
#GeneratedValue(strategy=GenerationType.SEQUENCE, generator="booking_seq")
#Column
private int bookingId;
#Column
private int roomId;
#Column
private int customerId;
#Column
#Temporal(javax.persistence.TemporalType.DATE)
private Date arrival_date;
#Column
#Temporal(javax.persistence.TemporalType.DATE)
private Date departure_date;
public Booking(int bookingId, int roomId, int customerId, Date arrival_date, Date departure_date) {
this.bookingId = bookingId;
this.roomId = roomId;
this.customerId = customerId;
this.arrival_date = arrival_date;
this.departure_date = departure_date;
}
public Booking() {
}
public int getBookingId() {
return bookingId;
}
public void setBookingId(int bookingId) {
this.bookingId = bookingId;
}
public int getRoomId() {
return roomId;
}
public void setRoomId(int roomId) {
this.roomId = roomId;
}
public int getCustomerId() {
return customerId;
}
public void setCustomerId(int customerId) {
this.customerId = customerId;
}
public Date getArrival_date() {
return arrival_date;
}
public void setArrival_date(Date arrival_date) {
this.arrival_date = arrival_date;
}
public Date getDeparture_date() {
return departure_date;
}
public void setDeparture_date(Date departure_date) {
this.departure_date = departure_date;
}
}
Room Entity
#Entity
#Table
#NamedQueries({#NamedQuery(name="Room.getAll",query="SELECT e FROM Room e order by e.roomId")})
public class Room implements Serializable {
private static final long serialVersionUID = 1L;
#Id
#GeneratedValue(strategy = GenerationType.AUTO)
#Column
private int roomId;
#Column
private String roomType;
#Column
private String bedType;
#Column
private double tariff;
public Room() {
}
public Room(int roomId, String roomType, String bedType, double tariff) {
this.roomId = roomId;
this.roomType = roomType;
this.bedType = bedType;
this.tariff = tariff;
}
public int getRoomId() {
return roomId;
}
public void setRoomId(int roomId) {
this.roomId = roomId;
}
public String getRoomType() {
return roomType;
}
public void setRoomType(String roomType) {
this.roomType = roomType;
}
public String getBedType() {
return bedType;
}
public void setBedType(String bedType) {
this.bedType = bedType;
}
public double getTariff() {
return tariff;
}
public void setTariff(double tariff) {
this.tariff = tariff;
}
}
The session bean for Booking Entity
#Stateless
public class BookingDAO implements BookingDAOLocal {
#PersistenceContext
private EntityManager em;
#Override
public void addBooking(Booking booking) {
em.persist(booking);
}
#Override
public void editBooking(Booking booking) {
em.merge(booking);
}
#Override
public void deleteBooking(int bookingId) {
em.remove(em.find(Booking.class, bookingId));
}
}
The session bean for Room Entity
#Stateless
public class RoomDAO implements RoomDAOLocal {
#PersistenceContext
private EntityManager em;
#Override
public void addRoom(Room room) {
em.merge(room);
em.flush();
}
#Override
public void editRoom(Room room) {
em.merge(room);
em.flush();
}
#Override
public void deleteRoom(int roomId) {
em.remove(em.find(Room.class, roomId));
}
}
Actually i got the answer now. For the editBooking() method i was using the same code as addBooking(). In addBooking() i didnt have the setBookingId() method call as it was autogenerated. Just needed to add the extra part for edit method.
else if ("Add".equalsIgnoreCase(action) || "Edit".equalsIgnoreCase(action) )
{
try {
arrival_date = new SimpleDateFormat("MM/dd/yyyy", Locale.ENGLISH).parse(request.getParameter("arrival_date"));
departure_date = new SimpleDateFormat("MM/dd/yyyy", Locale.ENGLISH).parse(request.getParameter("departure_date"));
}
catch(ParseException e) {
e.printStackTrace();
}
Booking booking = new Booking();
if("Edit".equalsIgnoreCase(action))
{
int bookingId=Integer.parseInt(request.getParameter("bookingId"));
booking.setBookingId(bookingId);
}
booking.setRoomId(Integer.parseInt(request.getParameter("roomId")));
booking.setCustomerId(customerId);
booking.setArrival_date(arrival_date);
booking.setDeparture_date(departure_date);
if("Add".equalsIgnoreCase(action))
bookingDao.addBooking(booking);
else
bookingDao.editBooking(booking);
request.setAttribute("allBookings", bookingDao.getAllBookings());
request.getRequestDispatcher("booking_details.jsp").forward(request, response);
}
You are not trying to updating the record, you re trying to persisting the same room instead of try this.
#Override
public void editRoom(Room room) {
Room r-= em.merge(room);
r.setRoomType("2bed"); // your own update field other than the #Id (Primary key)
em.flush();
// you can retun the updated employee.
}
How can I write the following relationship in JPA. I have 6 tables: Products, Features, Functions, Tasks, Permissions and Users. I need to be able to create a Product object model that contains a list of Features. Each Feature object model in the list will contain a list of Functions and each Function will contain a list of Tasks. I have no issue building each one of these entities and then relating them together but the problem comes in when I need to filter each entity by its relationship to the Permission table. I'm not sure this can be done. When I map the Permissions entity to each other entity, I seem to get a many-to-many join and too many values are returned. Any insight would be great.
Products
prod_id
user_id
Features
prod_id
feature_id
Functions
prod_id
feature_id
function_id
Tasks
prod_id
feature_id
function_id
task_id
Permissions
prod_id
feature_id
function_id
task_id
user_id
User
user_id
Here is my Permission entity class:
import java.io.Serializable;
import javax.persistence.*;
import static javax.persistence.CascadeType.ALL;
import java.math.BigDecimal;
#IdClass(menu.entity.PermissionKey.class)
#Entity
#Table(name="PERMISSIONS")
#NamedQuery(name = "findPermissionsByUserId",query = "SELECT p FROM Permission p WHERE p.userId = :userId")
public class Permission implements Serializable {
private static final long serialVersionUID = 1L;
#Column(name="AUTH", length=1)
private String auth;
#Column(name="PERM_DESC", length=80)
private String permDesc;
#Id
#Column(name="COMPANY",
nullable = false,
insertable = false,
updatable = false,
length=2)
private String company;
#Id
#Column(name="USER_ID",
nullable = false,
insertable = false,
updatable = false,
length=30)
private String userId;
#Id
#Column(name="PROD_ID", precision=22)
private BigDecimal prodId;
#Id
#Column(name="FEATURE", precision=22)
private BigDecimal feature;
#Id
#Column(name="FUNC", precision=22)
private BigDecimal func;
#Id
#Column(name="TASK", precision=22)
private BigDecimal task;
//uni-directional one-to-one association to Product
#OneToOne(cascade=ALL, mappedBy="permission")
private Product productObj;
#OneToOne(cascade=ALL, mappedBy="permission")
private Feature featureObj;
#OneToOne(cascade=ALL, mappedBy="permission")
private Function functionObj;
#OneToOne(cascade=ALL, mappedBy="permission")
private Task taskObj;
#ManyToOne(optional = false, fetch = FetchType.LAZY)
#JoinColumns({
#JoinColumn(name="USER_ID", referencedColumnName="USER_ID"),
#JoinColumn(name="COMPANY", referencedColumnName="COMPANY")
})
private User user;
public Permission() {
}
public String getAuth() {
return this.auth;
}
public void setAuth(String auth) {
this.auth = auth;
}
public String getCompany() {
return this.company;
}
public void setCompany(String company) {
this.company = company;
}
public String getPermDesc() {
return this.permDesc;
}
public void setPermDesc(String permDesc) {
this.permDesc = permDesc;
}
public String getUserId() {
return this.userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public BigDecimal getProdId() {
return prodId;
}
public void setProdId(BigDecimal prodId) {
this.prodId = prodId;
}
public BigDecimal getFeature() {
return this.feature;
}
public void setFeature(BigDecimal feature) {
this.feature = feature;
}
public BigDecimal getFunc() {
return func;
}
public void setFunc(BigDecimal func) {
this.func = func;
}
public BigDecimal getTask() {
return task;
}
public void setTask(BigDecimal task) {
this.task = task;
}
public Product getProductObj() {
return this.productObj;
}
public void setProductObj(Product productObj) {
this.productObj = productObj;
}
public Feature getFeatureObj() {
return this.featureObj;
}
public void setFeatureObj(Feature featureObj) {
this.featureObj = featureObj;
}
public Function getFunctionObj() {
return this.functionObj;
}
public void setFunctionObj(Function functionObj) {
this.functionObj = functionObj;
}
public User getUser() {
return this.user;
}
public void setUser(User user) {
this.user = user;
}
public Task getTaskObj() {
return this.taskObj;
}
public void setTaskObj(Task taskObj) {
this.taskObj = taskObj;
}
}