Commit f5f7f4c3 authored by Noel Alonso's avatar Noel Alonso
Browse files

Elimina componentes del servicio de topónimos

Actualmente no se utiliza este servicio
parent c0d345bf
Loading
Loading
Loading
Loading
+0 −48
Original line number Diff line number Diff line
package es.redmic.db.geodata.toponym.mapper;

/*-
 * #%L
 * DB
 * %%
 * Copyright (C) 2019 REDMIC Project / Server
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import org.springframework.stereotype.Component;

import es.redmic.db.geodata.toponym.model.Toponym;
import es.redmic.models.es.geojson.toponym.dto.ToponymDTO;
import es.redmic.models.es.geojson.toponym.dto.ToponymPropertiesDTO;
import ma.glasnost.orika.CustomMapper;
import ma.glasnost.orika.MappingContext;

@Component
public class ToponymMapper extends CustomMapper<Toponym, ToponymDTO> {

	@Override
	public void mapAtoB(Toponym a, ToponymDTO b, MappingContext context) {
		ToponymPropertiesDTO properties = mapperFacade.map(a, ToponymPropertiesDTO.class);
		b.setGeometry(a.getGeometry());
		b.setProperties(properties);
		b.setId(a.getId());
	}

	@Override
	public void mapBtoA(ToponymDTO b, Toponym a, MappingContext context) {
		mapperFacade.map(b.getProperties(), a);
		a.setGeometry(b.getGeometry());
		a.setId(b.getId());
	}
}
+0 −106
Original line number Diff line number Diff line
package es.redmic.db.geodata.toponym.model;

/*-
 * #%L
 * DB
 * %%
 * Copyright (C) 2019 REDMIC Project / Server
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

import org.locationtech.jts.geom.Point;

import es.redmic.db.common.model.UuidModel;
import es.redmic.db.maintenance.toponym.model.ToponymType;

/**
 * The persistent class for the citation database view.
 *
 */
@Entity
@Table(name = "toponym")
@NamedQuery(name = "Toponym.findAll", query = "SELECT c FROM Toponym c")
public class Toponym extends UuidModel implements Serializable {
	private static final long serialVersionUID = 1L;

	private String name;

	@Column(nullable = false)
	private String description;

	@Column(name = "zoomlevel")
	private Integer zoomLevel;

	@ManyToOne
	@JoinColumn(name = "toponymtypeid")
	private ToponymType toponymType;

	@Column(name = "shape", nullable = false)
	Point geometry;

	public Toponym() {
		super();
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Integer getZoomLevel() {
		return zoomLevel;
	}

	public void setZoomLevel(Integer zoomLevel) {
		this.zoomLevel = zoomLevel;
	}

	public ToponymType getToponymType() {
		return toponymType;
	}

	public void setToponymType(ToponymType toponymType) {
		this.toponymType = toponymType;
	}

	public Point getGeometry() {
		return geometry;
	}

	public void setGeometry(Point geometry) {
		this.geometry = geometry;
		this.geometry.setSRID(4326);
	}
}
+0 −28
Original line number Diff line number Diff line
package es.redmic.db.geodata.toponym.repository;

/*-
 * #%L
 * DB
 * %%
 * Copyright (C) 2019 REDMIC Project / Server
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import es.redmic.databaselib.common.repository.BaseRepository;
import es.redmic.db.geodata.toponym.model.Toponym;

public interface ToponymRepository extends BaseRepository<Toponym, Long> {

}
+0 −38
Original line number Diff line number Diff line
package es.redmic.db.geodata.toponym.service;

/*-
 * #%L
 * DB
 * %%
 * Copyright (C) 2019 REDMIC Project / Server
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import es.redmic.db.common.service.ServiceRWImpl;
import es.redmic.db.geodata.toponym.model.Toponym;
import es.redmic.db.geodata.toponym.repository.ToponymRepository;
import es.redmic.models.es.geojson.toponym.dto.ToponymDTO;

@Service
public class ToponymService extends ServiceRWImpl<Toponym, ToponymDTO> {

	@Autowired
	public ToponymService(ToponymRepository repository) {
		super(repository);
	}
}
+0 −44
Original line number Diff line number Diff line
package es.redmic.db.maintenance.toponym.model;

/*-
 * #%L
 * DB
 * %%
 * Copyright (C) 2019 REDMIC Project / Server
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

import es.redmic.db.common.model.DomainModel;

/**
 * The persistent class for the citation database view.
 * 
 */
@Entity
@Table(name = "toponymtype")
@NamedQuery(name = "ToponymType.findAll", query = "SELECT c FROM ToponymType c")
public class ToponymType extends DomainModel implements Serializable {
	private static final long serialVersionUID = 1L;

	public ToponymType() {
		super();
	}
}
Loading