Package com.alibaba.otter.manager.biz.config.datamedia.dal.dataobject

Examples of com.alibaba.otter.manager.biz.config.datamedia.dal.dataobject.DataMediaDO


     */
    @Override
    public void create(DataMedia dataMedia) {
        Assert.assertNotNull(dataMedia);
        try {
            DataMediaDO dataMediaDo = modelToDo(dataMedia);
            dataMediaDo.setId(0L);
            if (!dataMediaDao.checkUnique(dataMediaDo)) {
                String exceptionCause = "exist the same name dataMedia in the database.";
                logger.warn("WARN ## " + exceptionCause);
                throw new RepeatConfigureException(exceptionCause);
            }
View Full Code Here


     */
    @Override
    public Long createReturnId(DataMedia dataMedia) {
        Assert.assertNotNull(dataMedia);
        try {
            DataMediaDO dataMediaDo = modelToDo(dataMedia);
            dataMediaDo.setId(0L);
            DataMediaDO dataMediaDoInDb = dataMediaDao.checkUniqueAndReturnExist(dataMediaDo);
            if (dataMediaDoInDb == null) {
                dataMediaDo = dataMediaDao.insert(dataMediaDo);
            } else {
                dataMediaDo = dataMediaDoInDb;
            }
View Full Code Here

     */
    @Override
    public void modify(DataMedia dataMedia) {
        Assert.assertNotNull(dataMedia);
        try {
            DataMediaDO dataMediaDo = modelToDo(dataMedia);
            if (dataMediaDao.checkUnique(dataMediaDo)) {
                dataMediaDao.update(dataMediaDo);
            } else {
                String exceptionCause = "exist the same name dataMedia in the database.";
                logger.warn("WARN ## " + exceptionCause);
View Full Code Here

     * @param dataMedia
     * @return DataMediaDO
     */
    private DataMediaDO modelToDo(DataMedia dataMedia) {

        DataMediaDO dataMediaDo = new DataMediaDO();

        try {
            dataMediaDo.setId(dataMedia.getId());
            dataMediaDo.setName(dataMedia.getName());
            dataMediaDo.setNamespace(dataMedia.getNamespace());
            dataMediaDo.setDataMediaSourceId(dataMedia.getSource().getId());
            // if (dataMedia instanceof DbDataMedia) {
            // dataMediaDo.setProperties(JsonUtils.marshalToString((DbDataMedia) dataMedia));
            // }
            dataMediaDo.setProperties(JsonUtils.marshalToString(dataMedia));
            dataMediaDo.setGmtCreate(dataMedia.getGmtCreate());
            dataMediaDo.setGmtModified(dataMedia.getGmtModified());
        } catch (Exception e) {
            logger.error("ERROR ## change the dataMedia Model to Do has an exception");
            throw new ManagerException(e);
        }

View Full Code Here

TOP

Related Classes of com.alibaba.otter.manager.biz.config.datamedia.dal.dataobject.DataMediaDO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.