view src/main/java/de/mpiwg/gazetteer/db/DBContents.java @ 40:35ed4e650a53

bug fixed: full text search when section not found in section_index table. add paginator
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Mon, 07 Dec 2015 17:06:57 +0100
parents 37840afb7b80
children 7c2e1b14b77d
line wrap: on
line source

package de.mpiwg.gazetteer.db;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

import de.mpiwg.gazetteer.utils.DBService;



public class DBContents implements Comparable<DBContents>{

	private Long id;
	
	private String bookId = "";
	private Integer page = 0;
	private String content = "";
	
	private DBSection section = null;	// section already contain DBBook
	private Integer inx = null;	// local index for each row
	
	private DBCoordinatesBook coordinatesBook = null;
	
	private boolean isRemoved = false;
	

	public DBContents(ResultSet rs) throws SQLException{
		
		this.id = rs.getLong("id");
		this.bookId = rs.getString("books_id");
		this.page = rs.getInt("line");
		this.content = rs.getString("content");

	}
	
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	

	public String getBookId() {
		return bookId;
	}

	public void setBookId(String bookId) {
		this.bookId = bookId;
	}



	public String getContent() {
		return content;
	}


	public void setContent(String content) {
		this.content = content;
	}


	public DBSection getSection() {
		return section;
	}


	public void setSection(DBSection section) {
		this.section = section;
	}

	

	public Integer getPage() {
		return page;
	}


	public void setPage(Integer page) {
		this.page = page;
	}


	public Integer getInx() {
		return inx;
	}


	public void setInx(Integer inx) {
		this.inx = inx;
	}



	public DBCoordinatesBook getCoordinatesBook() {
		return coordinatesBook;
	}


	public void setCoordinatesBook(DBCoordinatesBook coordinatesBook) {
		this.coordinatesBook = coordinatesBook;
	}


	public boolean isRemoved() {
		return isRemoved;
	}


	public void setRemoved(boolean isRemoved) {
		this.isRemoved = isRemoved;
	}


	
	@Override
	public int compareTo(DBContents o) {
		return this.getId().compareTo(o.getId());
	}
	
}