private void staticHandle(QueueEntry queueEntry, AisVesselTarget vesselTarget) {
		AisMessage aisMessage = queueEntry.getAisMessage();
		
		// Mappers
		AisVesselStaticMapper aisVesselStaticMapper = session.getMapper(AisVesselStaticMapper.class);
		AisClassAStaticMapper aisClassAStaticMapper = session.getMapper(AisClassAStaticMapper.class);
		boolean createStatic = false;
		boolean createStaticA = false;
		
		AisVesselStatic vesselStatic = aisVesselStaticMapper.selectByPrimaryKey(vesselTarget.getMmsi());
		if (vesselStatic == null) {
			createStatic = true;
			vesselStatic = new AisVesselStatic();
			vesselStatic.setMmsi(vesselTarget.getMmsi());
			vesselStatic.setCreated(new Date());
		}
		vesselStatic.setReceived(queueEntry.getReceived());
		
		AisClassAStatic classAStatic = null;
		
		if (aisMessage instanceof AisMessage24) {
			// Class B
			AisMessage24 msg24 = (AisMessage24) aisMessage;
			if (msg24.getPartNumber() == 0) {
				vesselStatic.setName(msg24.getName());
			} else {
				vesselStatic.setCallsign(msg24.getCallsign());
				vesselStatic.setDimBow((short) msg24.getDimBow());
				vesselStatic.setDimPort((byte) msg24.getDimPort());
				vesselStatic.setDimStarboard((byte) msg24.getDimStarboard());
				vesselStatic.setDimStern((short) msg24.getDimStern());
				vesselStatic.setShipType((byte) msg24.getShipType());								
				ShipTypeCargo shipTypeCargo = new ShipTypeCargo(msg24.getShipType());
				vesselStatic.setDecodedShipType((byte)shipTypeCargo.getShipType().ordinal());
				vesselStatic.setCargo((byte)shipTypeCargo.getShipCargo().ordinal());
			}
		} else {
			// Class A
			AisMessage5 msg5 = (AisMessage5) aisMessage;
			vesselStatic.setName(msg5.getName());
			vesselStatic.setCallsign(msg5.getCallsign());
			vesselStatic.setDimBow((short) msg5.getDimBow());
			vesselStatic.setDimPort((byte) msg5.getDimPort());
			vesselStatic.setDimStarboard((byte) msg5.getDimStarboard());
			vesselStatic.setDimStern((short) msg5.getDimStern());
			vesselStatic.setShipType((byte) msg5.getShipType());
			ShipTypeCargo shipTypeCargo = new ShipTypeCargo(msg5.getShipType());
			vesselStatic.setDecodedShipType((byte)shipTypeCargo.getShipType().ordinal());
			vesselStatic.setCargo((byte)shipTypeCargo.getShipCargo().ordinal());

			// Class A specifics
			classAStatic = aisClassAStaticMapper.selectByPrimaryKey(vesselTarget.getMmsi());			
			if (classAStatic == null) {
				createStaticA = true;
				classAStatic = new AisClassAStatic();
				classAStatic.setMmsi(vesselStatic.getMmsi());
			}
			classAStatic.setDestination(AisMessage.trimText(msg5.getDest()));
			classAStatic.setDraught((short) msg5.getDraught());
			classAStatic.setDte((byte) msg5.getDte());
			classAStatic.setEta(msg5.getEtaDate());
			classAStatic.setImo((int) msg5.getImo());
			classAStatic.setPosType((byte) msg5.getPosType());
			classAStatic.setVersion((byte) msg5.getVersion());
		}

		// Trim name and callsign
		vesselStatic.setName(AisMessage.trimText(vesselStatic.getName()));
		vesselStatic.setCallsign(AisMessage.trimText(vesselStatic.getCallsign()));

		if (createStatic) {
			aisVesselStaticMapper.insert(vesselStatic);
		} else {
			aisVesselStaticMapper.updateByPrimaryKey(vesselStatic);
		}
		
		if (classAStatic != null) {
			if (createStaticA) {
				aisClassAStaticMapper.insert(classAStatic);
			} else {
				aisClassAStaticMapper.updateByPrimaryKey(classAStatic);
			}
		}
		
	}