Commit 078b99e4 by Tuukka Kivilahti

one bug and maybe not so much that info, plz

1 parent 9366fc3c
......@@ -5,10 +5,7 @@
<persistence-unit name="MoyaDb">
<jta-data-source>jdbc/moyaDb</jta-data-source>
<properties>
<property name="eclipselink.ddl-generation" value="create-tables" />
<property name="eclipselink.cache.size.default" value="16384" />
<property name="eclipselink.ddl-generation.output-mode"
value="sql-script" />
<property name="eclipselink.logging.logger" value="ServerLogger" />
<property name="eclipselink.jdbc.uppercase-columns" value="false" />
<property name="eclipselink.target-database"
......@@ -18,6 +15,7 @@
<property name="eclipselink.target-server" value="Glassfish" />
<property name="eclipselink.session.customizer"
value="fi.codecrew.moya.database.eclipselink.MoyaSessionCustomizer" />
<property name="eclipselink.ddl-generation" value="none"/>
</properties>
</persistence-unit>
......
......@@ -184,8 +184,8 @@ public class Lecture extends GenericEntity {
newLecture.setName(getName());
newLecture.setHours(getHours());
newLecture.setMaxParticipantsCount(getMaxParticipantsCount());
newLecture.setStartTime(getStartTime());
newLecture.setOpenForRoles(getOpenForRoles());
newLecture.setStartTime( (Calendar) getStartTime().clone());
newLecture.setOpenForRoles(new ArrayList<Role>(getOpenForRoles()));
return newLecture;
}
......
......@@ -21,7 +21,7 @@ public class JsonAttributeConverter implements AttributeConverter<JsonObject, PG
* JsonObject -> PGobject
*/
public PGobject convertToDatabaseColumn(JsonObject jsonObject) {
log.info("Converting JsonObject to PGobject. Original JsonObject: {}", jsonObject);
//log.info("Converting JsonObject to PGobject. Original JsonObject: {}", jsonObject);
PGobject pgObject = new PGobject();
pgObject.setType("json");
......@@ -34,7 +34,7 @@ public class JsonAttributeConverter implements AttributeConverter<JsonObject, PG
} catch (SQLException e) {
log.warn("PGobject.setValue() threw an exception. Should not happen. Something is wrong.", e);
}
log.info("Converted JsonObject to PGobject: {}", pgObject);
// log.info("Converted JsonObject to PGobject: {}", pgObject);
return pgObject;
}
......@@ -42,11 +42,11 @@ public class JsonAttributeConverter implements AttributeConverter<JsonObject, PG
* PGobject -> JsonObject
*/
public JsonObject convertToEntityAttribute(PGobject pgObject) {
log.info("Converting PGobject to JsonObject. Original PGobject: {}", pgObject);
// log.info("Converting PGobject to JsonObject. Original PGobject: {}", pgObject);
// Convert null values to empty object
if (pgObject == null) {
log.info("PGobject was null. Retruning an empty JsonObject.");
// log.info("PGobject was null. Retruning an empty JsonObject.");
return Json.createObjectBuilder().build();
}
......@@ -63,7 +63,7 @@ public class JsonAttributeConverter implements AttributeConverter<JsonObject, PG
if (stringValue != null && !stringValue.toLowerCase().equals("null")) {
JsonReader jsonReader = Json.createReader(new StringReader(stringValue));
JsonObject jsonObject = jsonReader.readObject();
log.info("Converted PGobject to JsonObject: {}", jsonObject);
// log.info("Converted PGobject to JsonObject: {}", jsonObject);
return jsonObject;
} else {
log.info("Null value. Returning empty JsonObject");
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!