I am generating a List when you first load the JSF page. It is a #PostConstruct method.
However, It is causing my variable "Title" in my "FilmResultBean" to be null and I do not understand why.
Relevant Code:
DataTableBean:
#Component
#ManagedBean(name= DataTableBean.BEAN_NAME)
#Scope("request")
public class DataTableBean implements Serializable {
public static final String BEAN_NAME = "dataTableBean";
public static Logger logger = Logger.getLogger(DataTableBean.class);
#Autowired
#ManagedProperty(value = "filmResultBean")
FilmResultBean resultBean;
#Autowired
FilmBo filmBo;
private List<FilmResultBean> filmList;
private List<String> categoryList;
private String categoryName;
private String titleInput;
/* Default Constructor */
public DataTableBean() {
}
/*Queries the Database for a list of Film Objects and returns the films in
* a list of type "FilmResultBean"
*/
#PostConstruct
public void init(){
filmList = filmBo.generateFilmList(resultBean);
}
public void searchByBoth(){
filmList = filmBo.searchByBoth(resultBean);
logger.info("FilmList Inside SEARCHBYBOTH: " + filmList);
}
public String getTitleInput() {
return titleInput;
}
public void setTitleInput(String titleInput) {
this.titleInput = titleInput;
}
public List<String> getCategoryList() {
return categoryList;
}
public void setCategoryList(List<String> categoryList) {
this.categoryList = categoryList;
}
public String getCategoryName() {
return categoryName;
}
public void setCategoryName(String categoryName) {
this.categoryName = categoryName;
}
public void searchFilms(){
}
public List<FilmResultBean> getFilmList() {
return filmList;
}
public void setFilmList(List<FilmResultBean> filmList) {
this.filmList = filmList;
}
}
JSF Page:(The value is what is coming back as Null,Only when I use #PostConstruct)
<ace:textEntry value="#{filmResultBean.title}">
<ace:ajax listener="#{dataTableBean.searchByBoth}" execute="#this" render="form" />
</ace:textEntry>
Specific Method being called by #PostConstruct:
#Override
public List<FilmResultBean> generateFilmList(FilmResultBean films) {
Session session = getCurrentSession();
List<FilmResultBean> filmList;
Film film = new Film();
Query query = null;
films.setTitle(film.getTitle());
films.setRating(film.getRating());
films.setRentalRate(film.getRentalRate());
String hql;
hql = "from Film";
query = session.createQuery(hql);
logger.info("Query: " + query);
filmList = (query.list());
return filmList;
}
FilmResultBean:
#Component
#ManagedBean
#SessionScoped
#Scope("session")
public class FilmResultBean implements Serializable {
BigDecimal rentalRate;
Short length;
String rating;
String title;
String category;
public FilmResultBean() {
}
public FilmResultBean(BigDecimal rentalRate, Short length, String rating,
String title, String category) {
this.rentalRate = rentalRate;
this.length = length;
this.rating = rating;
this.title = title;
this.category = category;
}
public BigDecimal getRentalRate() {
return rentalRate;
}
public void setRentalRate(BigDecimal rentalRate) {
this.rentalRate = rentalRate;
}
public Short getLength() {
return length;
}
public void setLength(Short length) {
this.length = length;
}
public String getRating() {
return rating;
}
public void setRating(String rating) {
this.rating = rating;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
#Override
public String toString() {
return title;
}
}
Logger Info :
23:51:41,013 INFO om.cooksys.training.dao.impl.FilmDaoImpl: 82 - Title: null
23:51:41,013 INFO om.cooksys.training.dao.impl.FilmDaoImpl: 83 - Category: null
23:51:41,038 INFO om.cooksys.training.dao.impl.FilmDaoImpl: 92 - Query: QueryImpl(select new com.cooksys.training.FilmResultBean(fc.film.rentalRate, fc.film.length, fc.film.rating, fc.film.title, fc.category.name) from Film f join f.filmCategories fc where f.title like :title)
Hibernate:
select
film2_.rental_rate as col_0_0_,
film2_.length as col_1_0_,
film2_.rating as col_2_0_,
film2_.title as col_3_0_,
category6_.name as col_4_0_
from
sakila.film film0_
inner join
sakila.film_category filmcatego1_
on film0_.film_id=filmcatego1_.film_id,
sakila.film film2_,
sakila.category category6_
where
filmcatego1_.film_id=film2_.film_id
and filmcatego1_.category_id=category6_.category_id
and (
film0_.title like ?
)
23:51:41,045 INFO com.cooksys.training.DataTableBean: 63 - FilmList Inside SEARCHBYBOTH: []
It seems that your variable (and others like Category) are null because the injection of the managed bean as property is not correctly performed, you've to specefiy its value by JSF EL expression: #ManagedProperty("#{filmResultBean}").
I think it's not recommended to mix Spring with JSF annotations for your beans and java classes, just keep one of them.
Within the method below, you're trying to set films's properties by empty film instance. The method parameter films is found unused then in the method, what's its utility ?
#Override
public List<FilmResultBean> generateFilmList(FilmResultBean films) {
...
Film film = new Film();
...
films.setTitle(film.getTitle());
films.setRating(film.getRating());
films.setRentalRate(film.getRentalRate());
...
}
Related
MedicalEntity:
#Entity
#Table(name="t_med_area")
public class MedicalEntity {
#Id
#GeneratedValue(strategy=GenerationType.IDENTITY)
#Column(name="med_area_id")
private Integer med_area_id;
#Column(name="med_area_cd")
private String area_code;
#Column(name="area_nm")
private String area_description;
#OneToMany(fetch = FetchType.LAZY,mappedBy="medical_area_id")
private List<ProviderEntity> resources;
#OneToMany(fetch = FetchType.LAZY,mappedBy="medAreaId")
private List<FacilityEntity> facility;
public List<ProviderEntity> getResources() {
return resources;
}
public void setResources(List<ProviderEntity> resources) {
this.resources = resources;
}
public List<FacilityEntity> getFacility() {
return facility;
}
public void setFacility(List<FacilityEntity> facility) {
this.facility = facility;
}
public Integer getMed_area_id() {
return med_area_id;
}
public void setMed_area_id(Integer med_area_id) {
this.med_area_id = med_area_id;
}
public String getArea_code() {
return area_code;
}
public void setArea_code(String area_code) {
this.area_code = area_code;
}
public String getArea_description() {
return area_description;
}
public void setArea_description(String area_description) {
this.area_description = area_description;
}
FacilityEntity:
#Entity
#Table(name="t_facility")
public class FacilityEntity implements Serializable{
private static final long serialVersionUID = 1L;
#Id
#GeneratedValue(strategy=GenerationType.IDENTITY)
#Column(name="id")
private Integer id;
#Column(name="facility_id")
private int facilityId;
#Column(name="facility_nm")
private String facilityName;
#Column(name="facility_code")
private String facilityCode;
#OneToMany(fetch = FetchType.LAZY,mappedBy="facility_id")
private List<ProviderEntity> resources;
#ManyToOne(fetch = FetchType.LAZY)
#JoinColumn(name="med_area_id")
private MedicalEntity medAreaId;
#Column(name="insert_dt")
private Date insertDt;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public int getFacilityId() {
return facilityId;
}
public void setFacilityId(int facilityId) {
this.facilityId = facilityId;
}
public String getFacilityName() {
return facilityName;
}
public void setFacilityName(String facilityName) {
this.facilityName = facilityName;
}
public String getFacilityCode() {
return facilityCode;
}
public void setFacilityCode(String facilityCode) {
this.facilityCode = facilityCode;
}
public List<ProviderEntity> getResources() {
return resources;
}
public void setResources(List<ProviderEntity> resources) {
this.resources = resources;
}
public MedicalEntity getMedAreaId() {
return medAreaId;
}
public void setMedAreaId(MedicalEntity medAreaId) {
this.medAreaId = medAreaId;
}
public Date getInsertDt() {
return insertDt;
}
public void setInsertDt(Date insertDt) {
this.insertDt = insertDt;
}
public FacilityEntity(Integer id, String facility_name, String facility_code) {
super();
this.id = id;
this.facilityName = facility_name;
this.facilityCode = facility_code;
}
public FacilityEntity() {
super();
}
}
Provider Entity:
#Entity
#Table(name="t_provider")
public class ProviderEntity implements Serializable {
#Id
#GeneratedValue(strategy=GenerationType.IDENTITY)
#Column(name="provider_id")
private Integer provider_id;
#Column(name="resource_cd")
private String resource_code;
#Column(name="first_nm")
private String first_name;
#Column(name="last_nm")
private String last_name;
#Column(name="middle_nm")
private String middle_name;
#Column(name="title_nm")
private String title;
#Column(name="department_nm")
private String department_name;
#ManyToOne(fetch = FetchType.LAZY)
#JoinColumn(name="home_med_area_id")
private MedicalEntity medical_area_id;
#ManyToOne(fetch = FetchType.LAZY)
#JoinColumn(name="home_facility_id")
private FacilityEntity facility_id;
public Integer getProvider_id() {
return provider_id;
}
public void setProvider_id(Integer provider_id) {
this.provider_id = provider_id;
}
public String getResource_code() {
return resource_code;
}
public void setResource_code(String resource_code) {
this.resource_code = resource_code;
}
public String getFirst_name() {
return first_name;
}
public void setFirst_name(String first_name) {
this.first_name = first_name;
}
public String getLast_name() {
return last_name;
}
public void setLast_name(String last_name) {
this.last_name = last_name;
}
public String getMiddle_name() {
return middle_name;
}
public void setMiddle_name(String middle_name) {
this.middle_name = middle_name;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDepartment_name() {
return department_name;
}
public void setDepartment_name(String department_name) {
this.department_name = department_name;
}
public MedicalEntity getMedical_area_id() {
return medical_area_id;
}
public void setMedical_area_id(MedicalEntity medical_area_id) {
this.medical_area_id = medical_area_id;
}
public FacilityEntity getFacility_id() {
return facility_id;
}
public void setFacility_id(FacilityEntity facility_id) {
this.facility_id = facility_id;
}
public ProviderEntity() {
super();
}
}
Service Layer:
List<MedicalEntity> result=medicalAreaRepository.findAll();
//transforming entity into DTO and setting properties based on UI requirements
for(MedicalEntity medicalEntity:result)
{
MedicalDTO medicalDTO=new MedicalDTO();
medicalDTO.setArea_code(medicalEntity.getArea_code());
medicalDTO.setArea_description(medicalEntity.getArea_description());
medicalDTO.setId(medicalEntity.getMed_area_id());
//System.out.println(medicalEntity.getResources());
medicalResponse.addElementsToList(medicalDTO);
}
When I call hover over my List result, it automatically fires the query to load the facilities.
Logs which are generated:
Hibernate: select medicalent0_.med_area_id as med_area1_1_, medicalent0_.med_area_cd as med_area2_1_, medicalent0_.area_nm as area_nm3_1_ from t_med_area medicalent0_
2020-02-11 15:26:01.377 TRACE 39096 --- [nio-8080-exec-2] o.s.t.i.TransactionInterceptor : Completing transaction for [org.springframework.data.jpa.repository.support.SimpleJpaRepository.findAll]
2020-02-11 15:26:01.383 TRACE 39096 --- [nio-8080-exec-2] .s.t.s.TransactionSynchronizationManager : Removed value [org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$DefaultCrudMethodMetadata#2930e0de] for key [public abstract java.util.List org.springframework.data.jpa.repository.JpaRepository.findAll()] from thread [http-nio-8080-exec-2]
Hibernate: select z0_.med_area_id as med_area6_0_0_, z0_.id as id1_0_0_, z0_.id as id1_0_1_, z0_.facility_code as facility2_0_1_, z0_.facility_id as facility3_0_1_, z0_.facility_nm as facility4_0_1_, z0_.insert_dt as insert_d5_0_1_, z0_.med_area_id as med_area6_0_1_ from t_facility z0_ where z0_.med_area_id=?
Hibernate: select z0_.med_area_id as med_area6_0_0_, z0_.id as id1_0_0_, z0_.id as id1_0_1_, z0_.facility_code as facility2_0_1_, z0_.facility_id as facility3_0_1_, z0_.facility_nm as facility4_0_1_, z0_.insert_dt as insert_d5_0_1_, z0_.med_area_id as med_area6_0_1_ from t_facility z0_ where z0_.med_area_id=?
Hibernate: select z0_.med_area_id as med_area6_0_0_, z0_.id as id1_0_0_, z0_.id as id1_0_1_, z0_.facility_code as facility2_0_1_, z0_.facility_id as facility3_0_1_, z0_.facility_nm as facility4_0_1_, z0_.insert_dt as insert_d5_0_1_, z0_.med_area_id as med_area6_0_1_ from t_facility z0_ where z0_.med_area_id=?.
My question is: Why is it fetching the details of FacilityEntity?I am not explicitly making any calls to get the properties of FacilityEntity.
When you say 'hover' do you mean while debugging? If you inspect any of the lazy elements its akin to accessing them, so hibernate will attempt to lazy load the entity.
I have query:
public List<InvoiceItems> findAllBalance(String external_key) throws HibernateException {
return (List<InvoiceItems>) session.createQuery("select SUM(i.amount) as amount, t.record_id from Accounts a, InvoiceItems i, Tenant t WHERE a.record_id = i.account_record_id AND t.record_id=a.tenant_record_id AND a.external_key='"+external_key+"' group by i.tenant_record_id, t.record_id").list();
}
InvoiceItems.java:
package id.co.keriss.consolidate.ee;
import java.util.Date;
import org.jpos.ee.Accounts;
public class InvoiceItems {
private long record_id;
private String id;
private String type;
private String invoice_id;
private Accounts account_record_id;
private Tenant tenant_record_id;
private String description;
private long amount;
private Date created_date;
private String usage_name;
private String plan_name;
private String account_id;
public String getAccount_id() {
return account_id;
}
public void setAccount_id(String account_id) {
this.account_id = account_id;
}
public long getRecord_id() {
return record_id;
}
public void setRecord_id(long record_id) {
this.record_id = record_id;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getInvoice_id() {
return invoice_id;
}
public void setInvoice_id(String invoice_id) {
this.invoice_id = invoice_id;
}
public Accounts getAccount_record_id() {
return account_record_id;
}
public void setAccount_record_id(Accounts account_record_id) {
this.account_record_id = account_record_id;
}
public Tenant getTenant_record_id() {
return tenant_record_id;
}
public void setTenant_record_id(Tenant tenant_record_id) {
this.tenant_record_id = tenant_record_id;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public long getAmount() {
return amount;
}
public void setAmount(long amount) {
this.amount = amount;
}
public Date getCreated_date() {
return created_date;
}
public void setCreated_date(Date created_date) {
this.created_date = created_date;
}
public String getUsage_name() {
return usage_name;
}
public void setUsage_name(String usage_name) {
this.usage_name = usage_name;
}
public String getPlan_name() {
return plan_name;
}
public void setPlan_name(String plan_name) {
this.plan_name = plan_name;
}
}
then set to an variable:
List<InvoiceItems> invoiceItems = invoiceItemsDao.findAllBalance(jsonRecv.getString("externalkey"));
I want to get the value from that query, what I try:
LogSystem.info(request, "List : " + invoiceItems.get(0).getId();
I got an error "can't cast to InvoiceItems"
then I try changing from List<InvoiceItems> to just List
get with this :
LogSystem.info(request, "List : " + invoiceItems.get(0);
but the output like this not the value:
[Ljava.lang.Object;#41ea9df8
any advice? final result what i want is calculate amount of tenant
session.createQuery take HQL (Hibernate query language) however I see you use native SQL. Try using createSQLQuery method.
public List<InvoiceItems> findAllBalance(String external_key) throws HibernateException {
Query query = session.createSQLQuery("select SUM(i.amount) as amount, t.record_id from Accounts a, InvoiceItems i, Tenant t WHERE a.record_id = i.account_record_id AND t.record_id=a.tenant_record_id AND a.external_key='"+external_key+"' group by i.tenant_record_id, t.record_id");
query.setResultTransformer(Transformers.aliasToBean(InvoiceItems.class));
List<InvoiceItems> list = query.list();
return list;
}
I have this class:
public class Book extends SugarRecord {
private Long id;
private String mBookName;
private String mAuthorName;
private List<Page> mPageList;
public Book() {
}
public Book(String bookname, String authorName) {
mBookName = bookname;
mAuthorName = authorName;
mPageList = new ArrayList<>();
}
public Book(String bookname, String authorName, List<Page> pageList) {
mBookName = bookname;
mAuthorName = authorName;
mPageList = pageList;
}
#Override
public Long getId() {
return id;
}
#Override
public void setId(Long id) {
this.id = id;
}
public String getAuthorName() {
return mAuthorName;
}
public void setAuthorName(String authorName) {
mAuthorName = authorName;
}
public String getBookName() {
return mBookName;
}
public void setBookName(String bookName) {
mBookName = bookName;
}
}
The Page class isn't much but just in case:
public class Page {
private Long id;
private String mText;
public Page() {
}
public Page(String text) {
mText = text;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getText() {
return mText;
}
public void setText(String text) {
mText = text;
}
}
Right now I figure it makes sense to have two constructors, one for if you have pages already and one if you don't, but is this the right way to go about it? Or do I need to copy the ArrayList that comes into the constructor as opposed to merely referencing it?
The first constructor:
public Book(String bookname, String authorName) {
mBookName = bookname;
mAuthorName = authorName;
mPageList = new ArrayList<>();
}
Then you will have a new book without any page
The second constructor:
public Book(String bookname, String authorName, List<Page> pageList) {
mBookName = bookname;
mAuthorName = authorName;
mPageList = pageList;
}
You will have a new book with pages referenced to the pages (Might be in DB).
Since the arraylist in java is muttable , any changed data will be modified to the original data (See here Java Immutable Collections)
If you are going to used the data without any change to the origin data(Just copy) , you might should use the immutable collection to avoid this problem. But if you are going to used it with some modification ( I saw the class is extended SugarRecord), the second constructor will be alright for you.
I'm having trouble trying to understand how realm.io persist/save objects.
I have 3 Objects (Inventory, InventoryItem and Product);
When I create a Inventory containing InventoryItems it works fine until i close the app. When i re-open the app all InventoryItems loses the reference to Product and start to show "null" instead.
Strange thing is all other attributes like Inventory reference to InventoryItem is persisted fine. Just problem with Products.
this is how i'm trying to do:
Model
Product
public class Product extends RealmObject {
#PrimaryKey
private String id;
#Required
private String description;
private int qtdUnityType1;
private int qtdUnityType2;
private int qtdUnityType3;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public int getQtdUnityType1() {
return qtdUnityType1;
}
public void setQtdUnityType1(int qtdUnityType1) {
this.qtdUnityType1 = qtdUnityType1;
}
public int getQtdUnityType2() {
return qtdUnityType2;
}
public void setQtdUnityType2(int qtdUnityType2) {
this.qtdUnityType2 = qtdUnityType2;
}
public int getQtdUnityType3() {
return qtdUnityType3;
}
public void setQtdUnityType3(int qtdUnityType3) {
this.qtdUnityType3 = qtdUnityType3;
}
}
Inventory
public class Inventory extends RealmObject {
#PrimaryKey
private String id;
#Required
private String type;
#Required
private Date createdAt;
#Required
private String status;
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
private RealmList<InventoryItem> listItems;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public RealmList<InventoryItem> getListItems() {
return listItems;
}
public void setListItems(RealmList<InventoryItem> listItems) {
this.listItems = listItems;
}
}
InventoryItem
public class InventoryItem extends RealmObject {
#PrimaryKey
private String idItem;
private Inventory inventory;
private Product product;
public Product getProduct() {
return product;
}
public void setProduct(Product product) {
this.product = product;
}
private Date expirationDate;
private int qtdUnityType1;
private int qtdUnityType2;
private int qtdUnityType3;
private int qtdDiscard;
public String getIdItem() {
return idItem;
}
public void setIdItem(String idItem) {
this.idItem = idItem;
}
public Inventory getInventory() {
return inventory;
}
public void setInventory(Inventory inventory) {
this.inventory = inventory;
}
public Date getExpirationDate() {
return expirationDate;
}
public void setExpirationDate(Date expirationDate) {
this.expirationDate = expirationDate;
}
public int getQtdUnityType1() {
return qtdUnityType1;
}
public void setQtdUnityType1(int qtdUnityType1) {
this.qtdUnityType1 = qtdUnityType1;
}
public int getQtdUnityType2() {
return qtdUnityType2;
}
public void setQtdUnityType2(int qtdUnityType2) {
this.qtdUnityType2 = qtdUnityType2;
}
public int getQtdUnityType3() {
return qtdUnityType3;
}
public void setQtdUnityType3(int qtdUnityType3) {
this.qtdUnityType3 = qtdUnityType3;
}
public int getQtdDiscard() {
return qtdDiscard;
}
public void setQtdDiscard(int qtdDiscard) {
this.qtdDiscard = qtdDiscard;
}
}
and finally one of the millions ways i tried to persist
realm.beginTransaction();
Inventory inventory = realm.createObject(Inventory.class);
inventory.setId(id);
inventory.setCreatedAt(new DateTime().toDate());
if (radioGroup.getCheckedRadioButtonId() == R.id.rbInventario) {
inventory.setType("Inventário");
} else {
inventory.setType("Validade");
}
inventory.setStatus("Aberto");
RealmList<InventoryItem> inventoryItems = new RealmList<>();
RealmResults<Product> productsRealmResults = realm.allObjects(Product.class);
for (int i = 1; i <= productsRealmResults.size(); i++) {
InventoryItem item = realm.createObject(InventoryItem.class);
item.setIdProduct(productsRealmResults.get(i - 1).getId() + " - " + productsRealmResults.get(i - 1).getDescription());
item.setProduct(productsRealmResults.get(i - 1));
item.setIdItem(i + "-" + id);
item.setInventory(inventory);
item = realm.copyToRealmOrUpdate(item);
item = realm.copyToRealmOrUpdate(item);
inventoryItems.add(item);
}
inventory.setListItems(inventoryItems);
realm.copyToRealmOrUpdate(inventory);
realm.commitTransaction();
I already looked trough some answers here like this one:
stack answer
and the Java-examples (person, dog, cat)
provided with the API
but I can't understand how to properly insert this.
The problem is that you are setting a list of InventoryItem elements which are not added to the Realm database.
Change InventoryItem item = new InventoryItem(); to InventoryItem item = realm.createObject(InventoryItem.class);
Also, the inventoryItems themselves aren't stored in Realm db. Add realm.copyToRealmOrUpdate(inventoryItems) after the loop.
I want to convert the following query into HQL:
SELECT C.ID, E.DESCRIPTION as STATUS, E1.DESCRIPTION as SUBJECT
FROM CRED C
join CODE_EVN E
ON E.CODE = C.STATUS_CODE
AND E.SUBCODE = C.STATUS_SUBCODE
join CODE_EVN E1
ON E1.CODE = C.SUBJECT_CODE
AND E1.SUBCODE = C.SUBJECT_SUBCODE
I have two classes User and Codes with no mapping in between them, so how do I execute the following query in Hibernate?
I have tried out many things but nothing seems to work
These are my 2 bean classes:
User class:
#Entity
#Table(name="CRED")
public class User {
private String id;
private String STATUS_CODE;
private String STATUS_SUBCODE;
private String SUBJECT_CODE;
private String SUBJECT_SUBCODE;
#Id
#Column(name="ID")
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public void setSTATUS_CODE(String sTATUS_CODE) {
STATUS_CODE = sTATUS_CODE;
}
public String getSTATUS_CODE() {
return STATUS_CODE;
}
public void setSTATUS_SUBCODE(String sTATUS_SUBCODE) {
STATUS_SUBCODE = sTATUS_SUBCODE;
}
public String getSTATUS_SUBCODE() {
return STATUS_SUBCODE;
}
public void setSUBJECT_CODE(String sUBJECT_CODE) {
SUBJECT_CODE = sUBJECT_CODE;
}
public String getSUBJECT_CODE() {
return SUBJECT_CODE;
}
public void setSUBJECT_SUBCODE(String sUBJECT_SUBCODE) {
SUBJECT_SUBCODE = sUBJECT_SUBCODE;
}
public String getSUBJECT_SUBCODE() {
return SUBJECT_SUBCODE;
}
}
Codes class:
#Entity
#Table(name="CODE_EVN")
public class Codes {
#Id
private String CODE;
private String SUBCODE;
private String DESCRIPTION;
public void setCODE(String cODE) {
CODE = cODE;
}
public String getCODE() {
return CODE;
}
public void setSUBCODE(String sUBCODE) {
SUBCODE = sUBCODE;
}
public String getSUBCODE() {
return SUBCODE;
}
public void setDESCRIPTION(String dESCRIPTION) {
DESCRIPTION = dESCRIPTION;
}
public String getDESCRIPTION() {
return DESCRIPTION;
}
}