Commit 2aa5c263 by Tuukka Kivilahti

Merge branch 'optimisations' into 'master'

Optimisations

Random minor fixes and optimisations. Notes in commit messages

See merge request !266
2 parents 469b7031 275ea778
......@@ -32,6 +32,9 @@ import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.eclipse.persistence.annotations.BatchFetch;
import org.eclipse.persistence.annotations.BatchFetchType;
import fi.codecrew.moya.utilities.NumericStringComparator;
/**
......@@ -69,6 +72,7 @@ public class Place extends GenericEntity implements Comparable<Place> {
private String code = "";
@OneToOne(mappedBy = "placeReservation")
@BatchFetch(BatchFetchType.EXISTS)
private GroupMembership placeReserver;
@Column(name = "buyable", nullable = false)
......@@ -104,6 +108,11 @@ public class Place extends GenericEntity implements Comparable<Place> {
@ManyToOne
private EventUser currentUser;
@OneToOne(mappedBy = "place")
@JoinColumn(nullable = true)
@BatchFetch(BatchFetchType.EXISTS)
private PlaceSlot reserverSlot;
public static enum PlaceState {
FREE, DISABLED, LOCKED, TEMP_RESERVED_FORME,
MY_PLACE, RESERVED
......@@ -138,10 +147,6 @@ public class Place extends GenericEntity implements Comparable<Place> {
return ret;
}
@OneToOne(mappedBy = "place")
@JoinColumn(nullable = true)
private PlaceSlot reserverSlot;
public Place() {
super();
}
......@@ -311,6 +316,7 @@ public class Place extends GenericEntity implements Comparable<Place> {
/**
* NOTE: you can newer be sure that this is up to date
*
* @return
*/
public PlaceSlot getReserverSlot() {
......@@ -361,13 +367,13 @@ public class Place extends GenericEntity implements Comparable<Place> {
if (this.getName() == null || o.getName() == null) {
if (this.getName() == null) {
return 1;
}
}
if (o.getName() == null) {
return -1;
}
return -1;
}
// both names are null. Compare IDs
return this.getNonNullId().compareTo(o.getNonNullId());
}
}
if (this.getName().equals(o.getName())) {
return 0;
......
......@@ -41,7 +41,7 @@
<h:body>
<!-- Javascript-lokalisaatiolippupuljausta -->
<h:form id="conversationKeepaliver">
<p:remoteCommand name="cdiKeepalive" update=":cdiloop" actionListener="#{conversationKeepaliveView.ping()}" />
<p:remoteCommand name="cdiKeepalive" onerror="location.reload();" update=":cdiloop" actionListener="#{conversationKeepaliveView.ping()}" />
</h:form>
<h:outputText id="cdiloop" value="#{conversationKeepaliveView.value}" />
......
......@@ -44,9 +44,7 @@ public class BortalApplicationWrapper implements Serializable {
app = bApp;
permissions = new ArrayList<IAppPermission>();
for (IAppPermission ap : bApp.getPermissions()) {
if (set != null) {
logger.info("App Match {}, {}", ap, set.contains(ap));
}
boolean has = set != null && set.contains(ap);
if (has)
{
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!