Dobry den,
nevite jak pomoci struts2+json prenest pouze List<Person>.
<action name="..." class=".." method="..">
<result name="success" type="json">
<param name="includeProperties">
personList
</param>
</result>
</action>
tohle me nefunguje, pokud neuvedu parametr includeProperties tak vse funguje, ale prenasi mi to dalsich x zbytecnych dat a ja potrebuji pouze list.
DEKUJI ZA RADY.
Příspěvky odeslané z IP adresy 77.48.59.–
Dobry den mam nasledujici problem.
Ve svem projektu vyuzivam spring + hibernate.
@Entity
public class Person{
@Id
int idPerson;
@Column(unique = true)
String login;
}
Vsechny anotace funguji az na unique = true;
Nevite prosim nekdo kde muze byt problem ? v applicationContext.xml mam nastaveny nasledujici
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="persistenceUnitName" value="pun" />
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="database" value="SQL_SERVER" />
<!-- <property name="database" value="MYSQL" /> -->
<property name="showSql" value="true" />
</bean>
</property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory"/>
</bean>
<tx:annotation-driven transaction-manager="transactionManager"/>
Dobry den,
nevim si rady a tak se obracim na toto forum.
(Tabulka1,Tabulka2) N:M
Tabulka1 (idTabulka2,jmenoTabulka1)
Tabulka2 (idTabulka2,jmenoTabulka2)
Vazebni_Tabulka(idTabulka1, idTabulka2, pocet)
Mam mapovani pomoci hibernate, tak ze v Tabulce1 mam vytvoreny AarryList
obsahujici hodnoty z tabulky Vazebni_Tabulka,a to same plati pro tabulku Tabulka2.
a potreboval bych poradit jak spravne vyresit to abych napriklad na www strance zobrazil tabulku obsahujici vzdy :
jmenoTabulka1,jmenoTabulka2,pocet_kusu.
pozn. Mam to reseny pres 2 vazby 1:M, jelikoz vazba M:N v hibernate nepodporuje(myslim) dalsi atributy nez jsou cizi klice ve vazebni tabulce.
Dekuji za kazdou radu
smiling smiley