Ticket:#
US:[US-ID]
Beschreibung:
master
VogelT 3 weeks ago
parent 6e1c294ed7
commit 05d19d629d

@ -1,10 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> <?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="web_shared"> <wb-module deploy-name="web_shared">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/> <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/> <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/resources"/>
<property name="context-root" value="web_shared"/> <property name="context-root" value="web_shared"/>
<property name="java-output-path" value="/web_shared/target/classes"/> <property name="java-output-path" value="/web_shared/target/classes"/>
</wb-module> </wb-module>
</project-modules> </project-modules>

@ -48,7 +48,7 @@ public class DBHandler {
static { static {
for (SchemataENUM sEnum : SchemataENUM.values()) { for (SchemataENUM sEnum : SchemataENUM.values()) {
try { try {
Configuration configuration = new Configuration().configure("META-INF2/" + sEnum.name() + ".cfg.xml"); Configuration configuration = new Configuration().configure("META-INF/" + sEnum.name() + ".cfg.xml");
System.out.println(configuration.getProperties()); System.out.println(configuration.getProperties());
@ -58,6 +58,7 @@ public class DBHandler {
try { try {
if (e instanceof org.hibernate.service.spi.ServiceException && e.getMessage().equals("Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]")) { if (e instanceof org.hibernate.service.spi.ServiceException && e.getMessage().equals("Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]")) {
System.out.println("Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment], [" + sEnum.name() +"] is probably not bound in this Context."); System.out.println("Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment], [" + sEnum.name() +"] is probably not bound in this Context.");
e.printStackTrace();
} else { } else {
e.printStackTrace(); e.printStackTrace();
System.out.println("Hibernateconfiguration is missing for: " + sEnum.name() + ". Please create a valid META-INF/" + sEnum.name() + ".cfg.xml."); System.out.println("Hibernateconfiguration is missing for: " + sEnum.name() + ". Please create a valid META-INF/" + sEnum.name() + ".cfg.xml.");

@ -19,7 +19,7 @@ public class Nlconnect implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id @Id
@GeneratedValue(strategy=GenerationType.IDENTITY) @GeneratedValue(strategy=GenerationType.AUTO)
@Column(unique=true, nullable=false) @Column(unique=true, nullable=false)
private BigInteger ncid = null; private BigInteger ncid = null;
public BigInteger getNcid() { return ncid; } public BigInteger getNcid() { return ncid; }
@ -50,6 +50,7 @@ public class Nlconnect implements Serializable {
private String nctype = null; private String nctype = null;
public String getNctype() { return nctype; } public String getNctype() { return nctype; }
public void setNctype(NanoTypeEnum nctype) { this.nctype = nctype.name(); } public void setNctype(NanoTypeEnum nctype) { this.nctype = nctype.name(); }
public void setNctype(String nctype) { this.nctype = nctype; }
@Column(precision=9, nullable = false) @Column(precision=9, nullable = false)
private Integer nccountpanel = null; private Integer nccountpanel = null;

@ -1,7 +1,8 @@
package de.tvo.database.tables.NLCONNECT; package de.tvo.database.tables.NLCONNECT;
import java.util.List;
import de.tvo.database.DBHandler; import de.tvo.database.DBHandler;
import de.tvo.nanoleaf.enums.NanoTypeEnum;
import de.tvo.toolset.DBTools.SchemataENUM; import de.tvo.toolset.DBTools.SchemataENUM;
public class NlconnectWorker { public class NlconnectWorker {
@ -21,7 +22,7 @@ public class NlconnectWorker {
boolean finish = true; boolean finish = true;
try { try {
DBHandler dbHandler = new DBHandler(SchemataENUM.MARIADBNL); DBHandler dbHandler = new DBHandler(SchemataENUM.MARIADBNL, true, true);
dbHandler.insertObject(nlconnect); dbHandler.insertObject(nlconnect);
@ -37,4 +38,21 @@ public class NlconnectWorker {
return finish; return finish;
} }
@SuppressWarnings("unchecked")
public List<Nlconnect> loadNlconnect() {
List<Nlconnect> nlconList = null;
try {
DBHandler dbHandler = new DBHandler(SchemataENUM.MARIADBNL, true, true);
nlconList = (List<Nlconnect>)dbHandler.loadAll("Nlconnect");
} catch (Exception e) {
e.printStackTrace();
throw e;
}
return nlconList;
}
} }

@ -0,0 +1,32 @@
<hibernate-configuration>
<session-factory>
<!-- JDBC-Verbindung -->
<property name="hibernate.connection.driver_class">org.mariadb.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mariadb://localhost:3306/mariadbnl</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">jhi1nPw.</property>
<!-- Hibernate Dialekt für MariaDB -->
<property name="hibernate.dialect">org.hibernate.dialect.MariaDBDialect</property>
<!-- Optional: SQL-Ausgabe -->
<property name="hibernate.show_sql">true</property>
<property name="hibernate.format_sql">true</property>
<!-- Schema-Handling -->
<property name="hibernate.hbm2ddl.auto">update</property>
<!-- Connection Pool (einfacher Hibernate-Pool) -->
<property name="hibernate.connection.pool_size">5</property>
<mapping class="de.tvo.database.tables.NLCONNECT.Nlconnect"/>
<!--
<mapping class="de.tvo.database.tables.NLPANEL.Nlpanel"/>
-->
</session-factory>
</hibernate-configuration>
Loading…
Cancel
Save