Notes
Notes - notes.io |
* Copyright 2006-2021 HighRadius Corporation
*/
package com.highradius.g4.service.catalogue.dao;
import static com.highradius.g4.service.catalogue.account.config.G4CatalogueDB.CATALOGUE_PU;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.springframework.stereotype.Repository;
import com.highradius.g4.catalogue.entity.dc.DcDatasetFilterFieldMetadata;
import com.highradius.g4.catalogue.entity.dc.DcFilter;
import com.highradius.g4.catalogue.entity.dc.DcObjectField;
import com.highradius.g4.catalogue.entity.dc.DcOperator;
import com.highradius.g4.catalogue.entity.dc.DcSubDatasetFieldFilterValue;
// TODO: Auto-generated Javadoc
/**
* The Class DatasetFilterDAO.
*/
@Repository
public class DatasetFilterDAO {
/** The entity manager. */
@PersistenceContext(unitName = CATALOGUE_PU)
private EntityManager g4CatalogueEntityManager;
/**
* Save dataset filter.
*
* @param dcFilters the dc filters
* @return the list
*/
public List<DcFilter> saveDatasetFilter(List<DcFilter> dcFilters) {
dcFilters.forEach(dcFilter -> {
g4CatalogueEntityManager.merge(dcFilter);
});
return dcFilters;
}
/**
* Gets the data source field name.
*
* @param dcDataSourceId the dc data source id
* @param dcObjectId the dc object id
* @return the data source field name
*/
public List<DcDatasetFilterFieldMetadata> getDataSourceFieldName(Long dcDataSourceId, Long dcObjectId) {
return g4CatalogueEntityManager.createQuery(
"from DcDatasetFilterFieldMetadata where dcDataSource.pkDcDataSourceId= :dcDataSourceId and dcObject.pkDcObjectId=:dcObjectId",
DcDatasetFilterFieldMetadata.class).setParameter("dcDataSourceId", dcDataSourceId)
.setParameter("dcObjectId", dcObjectId).getResultList();
}
/**
* Gets the operator.
*
* @return the operator
*/
public List<DcOperator> getOperator() {
return g4CatalogueEntityManager.createQuery("from DcOperator", DcOperator.class).getResultList();
}
/**
* Gets the dc object field.
*
* @param dcObjectId the dc object id
* @return the dc object field
*/
public List<DcObjectField> getDcObjectField(Long dcObjectId) {
return g4CatalogueEntityManager
.createQuery("From DcObjectField where dcObject.pkDcObjectId=:dcObjectId", DcObjectField.class)
.setParameter("dcObjectId", dcObjectId).getResultList();
}
/**
* Save dc sub dataset field filter value.
*
* @param dcSubDatasetFieldFilterValue the dc sub dataset field filter value
* @return the dc sub dataset field filter value
*/
public DcSubDatasetFieldFilterValue saveDcSubDatasetFieldFilterValue(
DcSubDatasetFieldFilterValue dcSubDatasetFieldFilterValue) {
g4CatalogueEntityManager.merge(dcSubDatasetFieldFilterValue);
return dcSubDatasetFieldFilterValue;
}
/**
* Update dc sub dataset field filter value.
*
* @param dcSubDatasetFieldFilterValue the dc sub dataset field filter value
* @return the dc sub dataset field filter value
*/
public DcSubDatasetFieldFilterValue updateDcSubDatasetFieldFilterValue(
DcSubDatasetFieldFilterValue dcSubDatasetFieldFilterValue) {
g4CatalogueEntityManager.persist(dcSubDatasetFieldFilterValue);
return dcSubDatasetFieldFilterValue;
}
/**
* Find dc sub dataset field filter value.
*
* @param pkDcSubDatasetFieldFilterId the pk dc sub dataset field filter id
* @return the dc sub dataset field filter value
*/
public DcSubDatasetFieldFilterValue findDcSubDatasetFieldFilterValue(Long pkDcSubDatasetFieldFilterId) {
g4CatalogueEntityManager.find(DcSubDatasetFieldFilterValue.class, pkDcSubDatasetFieldFilterId);
return g4CatalogueEntityManager.find(DcSubDatasetFieldFilterValue.class, pkDcSubDatasetFieldFilterId);
}
}
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team