Skip to content

Commit

Permalink
Initial commit of branch locanda-questura
Browse files Browse the repository at this point in the history
-New models.questura
-New mappers questura
-New sqlTables
-New services questura
-New resources questura
  • Loading branch information
paolo authored and paolo committed Oct 23, 2012
1 parent 0039710 commit 8448140
Show file tree
Hide file tree
Showing 29 changed files with 1,679 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sql/locanda.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;



--
-- Table structure for table `adjustment`
--
Expand Down
102 changes: 102 additions & 0 deletions src/model/Alloggiato.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
/*******************************************************************************
*
* Copyright 2011 - Sardegna Ricerche, Distretto ICT, Pula, Italy
*
* Licensed under the EUPL, Version 1.1.
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* http://www.osor.eu/eupl
*
* Unless required by applicable law or agreed to in writing, software distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and limitations under the Licence.
* In case of controversy the competent court is the Court of Cagliari (Italy).
*******************************************************************************/
package model;

import java.io.Serializable;
import java.util.Date;

import model.questura.CodiceAlloggiato;

import javax.xml.bind.annotation.XmlRootElement;



import org.apache.solr.client.solrj.beans.Field;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;

@XmlRootElement
@JsonIgnoreProperties(ignoreUnknown = true)
public class Alloggiato implements Serializable{

@Field
private Integer id;
@Field
private Integer idBooking;
private Guest guest;
private CodiceAlloggiato codiceAlloggiato;

private Date fromDate;
private Date toDate;




@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Alloggiato other = (Alloggiato) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Guest getGuest() {
return guest;
}
public void setGuest(Guest guest) {
this.guest = guest;
}
public CodiceAlloggiato getCodiceAlloggiato() {
return codiceAlloggiato;
}
public void setCodiceAlloggiato(CodiceAlloggiato codiceAlloggiato) {
this.codiceAlloggiato = codiceAlloggiato;
}
public Date getFromDate() {
return fromDate;
}
public void setFromDate(Date fromDate) {
this.fromDate = fromDate;
}
public Date getToDate() {
return toDate;
}
public void setToDate(Date toDate) {
this.toDate = toDate;
}


}
17 changes: 17 additions & 0 deletions src/model/Booking.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,16 @@ public class Booking implements Serializable{
private Integer id_convention = null;
private Integer id_room = null;

private List<Alloggiato> registroAlloggiati;

public Booking(){
this.extras = new ArrayList<Extra>();
this.adjustments = new ArrayList<Adjustment>();
this.payments = new ArrayList<Payment>();
this.guests = new ArrayList<Guest>();
this.extraItems = new ArrayList<ExtraItem>();
this.registroAlloggiati = new ArrayList<Alloggiato>();

}

public Integer calculateNumNights(){
Expand Down Expand Up @@ -212,6 +215,12 @@ public Boolean addExtraItem(ExtraItem anExtraItem){
public Boolean removeExtraItem(Guest anExtraItem){
return this.getExtraItems().remove(anExtraItem);
}
public Boolean addAlloggiato(Alloggiato guest){
return this.getRegistroAlloggiati().add(guest);
}
public Boolean removeAlloggiato(Alloggiato guest){
return this.getRegistroAlloggiati().remove(guest);
}
@Override
public int hashCode() {
final int prime = 31;
Expand Down Expand Up @@ -350,4 +359,12 @@ public void setId_room(Integer id_room) {
this.id_room = id_room;
}

public List<Alloggiato> getRegistroAlloggiati() {
return registroAlloggiati;
}

public void setRegistroAlloggiati(List<Alloggiato> registroAlloggiati) {
this.registroAlloggiati = registroAlloggiati;
}

}
96 changes: 96 additions & 0 deletions src/model/Documento.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/*******************************************************************************
*
* Copyright 2011 - Sardegna Ricerche, Distretto ICT, Pula, Italy
*
* Licensed under the EUPL, Version 1.1.
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* http://www.osor.eu/eupl
*
* Unless required by applicable law or agreed to in writing, software distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and limitations under the Licence.
* In case of controversy the competent court is the Court of Cagliari (Italy).
*******************************************************************************/
package model;

import java.io.Serializable;

import model.questura.Comune;
import model.questura.Nazione;
import model.questura.TipoDocumento;
import model.questura.Luogo;


import javax.xml.bind.annotation.XmlRootElement;



import org.apache.solr.client.solrj.beans.Field;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;

@XmlRootElement
@JsonIgnoreProperties(ignoreUnknown = true)
public class Documento implements Serializable{


private Integer id;
@Field
private TipoDocumento tipoDocumento;
@Field
private String numeroDocumento; //max 20 char
@Field
private Luogo luogoRilascio; //Nazione OR Comune Type



@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Documento other = (Documento) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public TipoDocumento getTipoDocumento() {
return tipoDocumento;
}
public void setTipoDocumento(TipoDocumento tipoDocumento) {
this.tipoDocumento = tipoDocumento;
}
public String getNumeroDocumento() {
return numeroDocumento;
}
public void setNumeroDocumento(String numeroDocumento) {
this.numeroDocumento = numeroDocumento;
}
public Luogo getLuogoRilascio() {
return luogoRilascio;
}
public void setLuogoRilascio(Luogo luogoRilascio) {
this.luogoRilascio = luogoRilascio;
}

}
60 changes: 60 additions & 0 deletions src/model/Guest.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
import java.io.Serializable;
import java.util.Date;

import model.Documento;
import model.questura.Comune;
import model.questura.Nazione;

import javax.xml.bind.annotation.XmlRootElement;


Expand Down Expand Up @@ -54,6 +58,22 @@ public class Guest implements Serializable{
private String idNumber;
@Field
private Integer id_structure;



private Comune comuneDiNascita; //comune e prov

private Nazione statoNascita; //

private Nazione cittadinanza;
private Integer id_cittadinanza;

private Comune residenza; //comune e prov

private Nazione statoResidenza;





@Override
Expand All @@ -79,6 +99,8 @@ public boolean equals(Object obj) {
return false;
return true;
}


public Integer getId() {
return id;
}
Expand Down Expand Up @@ -163,5 +185,43 @@ public String getBirthPlace() {
public void setBirthPlace(String birthPlace) {
this.birthPlace = birthPlace;
}
public Nazione getStatoNascita() {
return statoNascita;
}
public void setStatoNascita(Nazione statoNascita) {
this.statoNascita = statoNascita;
}
public Nazione getCittadinanza() {
return cittadinanza;
}
public void setCittadinanza(Nazione cittadinanza) {
this.cittadinanza = cittadinanza;
}
public Comune getResidenza() {
return residenza;
}
public void setResidenza(Comune residenza) {
this.residenza = residenza;
}
public Nazione getStatoResidenza() {
return statoResidenza;
}
public void setStatoResidenza(Nazione statoResidenza) {
this.statoResidenza = statoResidenza;
}
public Comune getComuneDiNascita() {
return comuneDiNascita;
}
public void setComuneDiNascita(Comune comuneDiNascita) {
this.comuneDiNascita = comuneDiNascita;
}
public Integer getId_cittadinanza() {
return id_cittadinanza;
}
public void setId_cittadinanza(Integer id_cittadinanza) {
this.id_cittadinanza = id_cittadinanza;
}



}
Loading

0 comments on commit 8448140

Please sign in to comment.