Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9177071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:15:05+00:00 2026-06-17T17:15:05+00:00

public List<Marki> getMarki() { List<Marki> markiList = null; try { Session session = HibernateSession.getSessionFactory().getCurrentSession();

  • 0
public List<Marki> getMarki()
      {
        List<Marki> markiList = null;
        try {
            Session session = HibernateSession.getSessionFactory().getCurrentSession();
            session.beginTransaction();
            Query q = session.createQuery("from Marki ");
            if ( q != null ) {
                markiList = ( List<Marki> ) q.list();
            }
            // session.getTransaction().commit();
        } catch ( Exception e ) {
            e.printStackTrace();
        }
        return markiList;
 }

Mapping

<hibernate-mapping>
    <class name="bazaMap.Marki" table="marki" schema="public">
        <id name="id" type="int">
            <column name="id" />
            <generator class="assigned" />
        </id>
        <property name="marka" type="serializable">
            <column name="marka" unique="true" />
        </property>
        <set name="modeles" inverse="true">
            <key>
                <column name="markaid" not-null="true" />
            </key>
            <one-to-many class="bazaMap.Modele" />
        </set>
    </class>
</hibernate-mapping>


N



CREATE TABLE marki
(
  id serial NOT NULL,
  marka character varying(32)[],
  CONSTRAINT glowny PRIMARY KEY (id),
  CONSTRAINT marki_marka_key UNIQUE (marka)
)
WITH (
  OIDS=FALSE
);
ALTER TABLE marki
  OWNER TO postgres;

FO: Hibernate: select marki0_.id as id3_, marki0_.marka as marka3_
from public.marki marki0_
INFO: could not read column value from result set: marka3_; could not deserialize
SEVERE: org.hibernate.type.SerializationException: could not deserialize
at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:217)
at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:240)
at org.hibernate.type.SerializableType.fromBytes(SerializableType.java:82)
at org.hibernate.type.SerializableType.get(SerializableType.java:39)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:163)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:154)
at org.hibernate.type.AbstractType.hydrate(AbstractType.java:81)
at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2096)
at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1380)
at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1308)
at org.hibernate.loader.Loader.getRow(Loader.java:1206)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:580)
at org.hibernate.loader.Loader.doQuery(Loader.java:701)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2220)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.hql.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:912)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at DataFetcher.getMarki(DataFetcher.java:40)

1.All the Mappings code were generated by NetBeans. Any ideas what could be wrong or even better – how to fix it?

blah
“Your post does not have much context to explain the code sections; please explain your scenario more clearly.”

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T17:15:05+00:00Added an answer on June 17, 2026 at 5:15 pm

    I bet this is your problem:

    marka character varying(32)[],
    

    You probably don’t want an array of characters. This is probably what you intend:

    marka varchar(32),
    

    Last I checked Hibernate doesn’t know how to deal with Postgres arrays out of the box, because few RDBMSes support them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The original code: public List<Contact> GetContactListEntityCompiledLINQ() { if (entities == null) entities = new
when using this method public List<Field> getFieldWithoutId(List<Integer> idSections) throws Exception { try { Connection
I have the this function: @Override public List<Expense> getExpensesBetween(Date firstDate, Date secondDate) { Query
what is wrong with such code public List<SearchItem> Search(string find) { return (from i
This is my class structure public class Customer { List<Address> add = null; public
public List<User> getAllUsers() { List<User> userList = new ArrayList<User>(); String selectQuery = SELECT *
I've got a public List<FriendProfile> friends = new ArrayList<FriendProfile>(); . I initialize the friends
class Foo(){ public List<string> SomeCollection; } I need to implement an event which can
I have the following code: public List<IWFResourceInstance> FindStepsByType(IWFResource res) { List<IWFResourceInstance> retval = new
In the web servce I say public List<Customer> GetCustomers() { PR1Entities dc = new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.